rllib  1
rlmodbusclient.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                     rlmodbusclient.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 07 2004
00005     copyright            : (C) 2004 by Rainer Lehrig
00006     email                : lehrig@t-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as        *
00013  *   published by the Free Software Foundation                             *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _RL_MODBUS_CLIENT_H_
00017 #define _RL_MODBUS_CLIENT_H_
00018 
00019 #include "rldefine.h"
00020 #include "rlmailbox.h"
00021 #include "rlsharedmemory.h"
00022 #include "rlmodbus.h"
00023 
00028 class rlModbusClient : public rlMailbox, rlSharedMemory
00029 {
00030   public:
00031     rlModbusClient(const char *mbxname, const char *shmname, int shmsize);
00032     virtual ~rlModbusClient();
00033     int write(int slave, int function, const unsigned char *data, int len);
00034     int writeSingleCoil(int slave, int adr, int value);
00035     int writeMultipleCoils(int slave, int adr, const unsigned char *values, int num_coils);
00036     int writePresetSingleRegister(int slave, int adr, int value);
00037     int writePresetMultipleRegisters(int slave, int adr, const int *values, int num_values);
00038     int readBit(int offset, int number);
00039     int readByte(int offset, int number);
00040     int readShort(int offset, int number);
00041 };
00042 
00043 #endif
00044