You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
425 B
C++
18 lines
425 B
C++
#include <QMutex>
|
|
|
|
class PLCDevice
|
|
{
|
|
public:
|
|
QMutex g_mutex; //访问Modbus的互斥锁
|
|
|
|
bool g_plc_ok;
|
|
|
|
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);
|
|
};
|