#include <QMutex>

class PLCDevice
{
public:
    QMutex g_mutex;				//访问Modbus的互斥锁

    bool g_plc_ok;

    //[0]:1=连接,0=断开
    uint8_t g_plc_status;

    static bool init_plc(PLCDevice *PLCptr);
    
	int write_bit_2_plc(int addr, int value);
	int read_bits_from_plc(int addr, int nb, uint8_t* value);
	int write_short_2_plc(int addr, int nb, uint16_t *value);
    int read_short_from_plc(int addr, int nb, uint16_t *value);
    bool disconnect_plc(void);
};
