Home
Linux_M-7000 _Manual-20150203
Contents
1. Type make or make DevicezUSB to compile the package Parameter s means silent the command command make use lipm7k a lib you can use dev ttyS device file to send receive Modbus protocol command make Device USB use libm7k usb a lib you can use dev ttyUSB device file to send receive Modbus protocol Please refer to the Figure 1 1 J Un 1J bel Ken W e de p N UU d oT Cf ct IO fer r3 di O Oo Oo O nN e Vi Tee hr Te SA lo 7 f 5 d A pm a e CA AN E g CA 1 J It Figure 1 1 1 2 M 7000 default setting Protocol Modbus RTU Module Address 01 DIO Type 40 Analog output type Type 32 0 10V Analog Input type Type 08 10V 10V Checksum disable Baud Rate 9600 bps Linux M 7000 User Manual Ver 1 0 Feb 2015 4 2 M 7000 Serial static Library Function Description The static library is the collection of function calls of the M 7000 Series The application structure is presented as below figure Figure 2 1 The user application program developed by C C language can call library libm7k a or libm7k usb a for M 7000 Series in user mode And then static library Will call the module command to access the hardware system Function Call into Library Development Toolkit Services Call into Kernel Mode Device Control Figure 2 1 Linux M 7000 User Manu
2. if print OK the setting is success Please refer to Figure 3 14 Figure 3 14 3 15 Demo read di counter trig This demo is used to read digital input channel counter trigger edge value of a module Please refer to Figure 3 15 Figure 3 15 Linux M 7000 User Manual Ver 1 0 Feb 2015 15 3 16 Demo set power on value Demo set power on value is used to set the power on value of a module This demo is set CHO CH8 power on value 1 if print OK the setting is success Please refer to Figure 3 16 Figure 3 16 3 17 Demo read power on value This demo is used to read power on value status of the device 0 Please refer to Figure 3 17 Figure 3 17 3 18 Demo set dio actice states Demo set dio actice state is used to set the DI O active states of a module DI O active states 7 6 5 4 3 2 1 0 Reserved DO active state 0 output value 1 for relay active output value 0 for relay inactive 1 output value 0 for relay active output value 1 for relay inactive DI active state 0 input value 1 for non signal or the low voltage input value 0 for high voltage 1 input value 0 for non signal or the low voltage input value 1 for high voltage Linux M 7000 User Manual Ver 1 0 Feb 2015 16 This demo is set value 0 to the device if print OK the setting is success Please refer to Figure 3 18 Figure 3 18 3 19 Demo read dio active states This demo is used to read the DI O active
3. to read protocol type of a module Please refer to Figure 3 26 Figure 3 26 3 27 Demo set watchdog This demo is used to set aio device watch dog if print OK the setting is success Please refer to Figure 3 27 Figure 3 27 Linux M 7000 User Manual Ver 1 0 Feb 2015 19 3 28 Demo set module add Demo set module add used to set new NETID to the aio device NETID will be changed Immediate This demo is set new NETID 2 to the device if print OK the setting is success Please refer to Figure 3 28 Figure 3 28 Linux M 7000 User Manual Ver 1 0 Feb 2015 20
4. Demoseimodebus 27 see nennen 11 3 3 Demogetmodbus nennen 11 3 4 Demo dom 12 39 Ponni RT 12 3 6 Demo do readback 2 1 eee 12 dif Lol Lia 13 3 8 Demo di counter i 13 3 9 Demo firmware ver 13 3 10 Demo module name een 14 3 11 Demo set mod add i 14 3 12 Demo set comm eet 14 3 13 Demo read comm eet eer 15 3 14 Demo set di counter trig 15 3 15 Demo read di counter trig 15 3 16 Demo set power on value i 16 3 17 Demo read power on value 0000nnnnsssoesenssssesseessssersessssssrressss 16 3 18 Demo set dio actice states n 16 3 19 Demo read dio active etates neeeesssssssssressssssss 17 3 20 Demo a0 cr 17 3 21 Demo ao WC e E Tei rita dee ouk psv Ex ob ke aa na vod au Y Se ERE RET EF pP Er suas 18 3 22 Demo ao set power on value eese 18 Linux M 7000 User Manual Ver 1 0 Feb 2015 2 3 23 3 24 3 25 3 26 3 27 3 28 Demo modules nam Luse 18 Demo TEN lO REE EE ee 19 Demo read COV SEL 19 DEMO read Protocol vr 19 Demo set_watchdog i 19 Demo set module add 20 Linux M 7000 User Manual Ver 1 0 Feb 2015 3 1 M 7000 lib compile amp default setting 1 1 M 7000 lib compile Step 1 Download the Linux Modbus lib m7k tar gz from ICP DAS website to the linux system Step 2 Decompress the tarball m7k tar gz Step 3 Type cd to m7k directory Step 4
5. HS Please refer to Figure 3 8 Lem ed kd VO a kd UJ NF C f n de Figure 3 8 3 9 Demo firmware ver This demo is used to read firmware version Please refer to Figure 3 9 Figuer 3 9 Linux M 7000 User Manual Ver 1 0 Feb 2015 13 3 10 Demo module name This demo is used to read device module name Please refer to Figure 3 10 Figure 3 10 3 11 Demo set mod add Demo set mod add is used to set new NETID to the dio device NETID will be changed Immediate This demo is set new NETID 2 to the device if print OK the setting is success Please refer to Figure 3 11 3 12 Demo set comm set Demo set comm set is used to set baud rate and protocol of a module those two settings will active when re power This demo is set baud rate 115200 to the device if print OK the setting is success Please refer to Figure 3 12 Figure 3 12 Linux M 7000 User Manual Ver 1 0 Feb 2015 14 3 13 Demo read comm set This demo is used to read baud rate and protocol Please refer to Figure 3 13 Figure 3 13 3 14 A Demo set di counter trig Demo set di counter trig is used to set the digital input counter trigger edge value of a module this setting will be changed Immediate 1 rising edge 0 falling edge For example 0x03 denotes that channels 0 1 are set as rising edge and channels 2 3 are set as falling edge This demo is set digital input CHO Ch4 rising edge to the device
6. Linux M 7000 Linux M 7000 User Manual Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assume no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use nor for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2015 by ICP DAS All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies Linux M 7000 User Manual Ver 1 0 Feb 2015 1 Tables of Content H r 1 M 7000 lib compile amp default settng 4 1 1 M 7000 lib compille i 4 1 2 M 7000 default setting i 4 2 M 7000 Serial static Library Function Description 5 2 1 Table of ErrorCode and ErrorString 6 2 2 System Functions 1 essere nennen 7 2 2 1 PN Gr 7 2 22 modbusRequesi ii 7 2 2 3 CIOSE COM 8 3 M 7000 series Demo Program For Lmuxg 9 3 1 Demo Modbus utility u 11 3 2
7. User Manual Ver 1 0 Feb 2015 9 Read di status di counter Read di trigger counters Set value to single do channel do readback Read do status Read firmware version module name Read module name Set value to multiple do channels Get module info with baud rate and Protocol Read the digital input counter trigger read di counter trig 9 P 99 edge value of a Module Read the DI O active states of a read dio active stats module read power on value Read the power on value of a module Set module info with baud rate and set comm set Protocol Set the digital input counter trigger set di counter trig 9 P 99 edge value of a module set dio actice state Set the DI O active states of a module Set the power on value of a module set mod add Set the address of a module read comm set Set value to single ao channel ao readback Read ao status ao set power on value Set the power on value of a module modules name Read module name multi ao Set value to multiple ao channels Get module info with baud rate and DPS bits Read protocol of a module read dev set read protocol set watchdoc Enable Disable watchdog Linux M 7000 User Manual Ver 1 0 Feb 2015 10 3 1 Demo Modbus utility This demo is used to detect device and show module name NETID baud rate Please refer to Figure 3 1 Figure 3 1 3 2 Demo setmodebus This demo is used to set value to specific address Please refer to Figur
8. al Ver 1 0 Feb 2015 5 2 1 Table of ErrorCode and ErrorString ENS RN code o NoEmmor OK Noeror o 4 FunctionError Use error function Open error port 3 BaudRateError 4 DataEmr Set Data bits error 5 StopEror Set Stop bits error gt 6 ParityError SetParitybitseror 7 CheckSumError Checksumemor 8 ComPortNotOpen Com port not open 10 SendCmdError Send command error 7 10 ReadComsStatusError Receive command status error ResultStrCheckError 15 TimeOut Exceeds predetermined time and no TE ee Table 1 1 Linux M 7000 User Manual Ver 1 0 Feb 2015 6 2 2 System Functions 2 2 1 Open Com Description Open specific device with device file Syntax Open Com char port DWORD baudrate char cData char cParity char cStop Parameter port Set com port number baudrate Set specific baudrate 1200 115200 cData Set Data bits cParity Set Parity bits cStop Set Stop bits Return PortError BaudRateError DataError ParityError StopError NoError 2 2 2 modbusRequest Description Send Modbus protocol request Syntax modbusRequest char cPort char cNetID char cFunction WORD wAddr WORD wCount unsigned char szBufl WORD wBufLen WORD wTimeout WORD wT Parameter cPort Choose com port number to send cNetlD Device NetID cFunction Modbus RTU protocol function code wAdar Addr
9. e 3 2 CA 12 m NE t a LEGG A co E CET ss S WES setmoanus IN e Ole w teagasg This command is set to analog output channel 0 value 6000 and time out 100ms 3 3 Demo getmodbus This demo is used to get value to specific address Please refer to Figure 3 3 Figure 3 3 This command is read analog channel channel 1 value Linux M 7000 User Manual Ver 1 0 Feb 2015 11 3 4 Demo do Demo do is used to set single digital output channel on or off This demo set channel 0 on if print OK the setting is success Please refer to Figure 3 4 Figure 3 4 3 5 Demo multi do Demo multi do is used to set multiple digital output on or off This demo set channel 0 amp 1 on if print OK the setting is success Please refer to Figure 3 5 e de ell n multi do Figure 3 5 3 6 Demo do readback Demo do readback is used to read digital output channel status This demo read digital output channel from CHO CHS Please refer to Figure 3 6 Figure 3 6 Linux M 7000 User Manual Ver 1 0 Feb 2015 12 3 7 Demo di Demo di is used to read digital input channel status This demo read digital input channel from CHO CHS Please refer to Figure 3 7 H O te E A E ld e EJ e O Af bog y Q e WI NF We Figure 3 7 3 8 Demo di counter Demo di counter is used to read di trigger counters This demo read digital input channel counters from CHO C
10. ess mapping wCount Channel numbers szBuf Set address value and receive response wBufLen szBuf length Linux M 7000 User Manual Ver 1 0 Feb 2015 7 wTimeout Set timeout wt response time ms Return UnderlnputRange ExceedInputRange FunctionError TimeOut ReadComStatusError ResultStrCheckError CmdError NoError 2 2 3 Close Com Description Close specific device with device file Syntax Close Com char port Parameter port Set com port number Return FunctionError PortError NoError Linux M 7000 User Manual Ver 1 0 Feb 2015 3 M 7000 series Demo Program For Linux All demo are work on M 7000 series device and protocol type is Modbus RTU If you linked libm7k a and then you should use device file name is dev ttyS If you linked libm7k usb a and then you should use device file name is dev ttyUSB Directory File Name Description Deor ie ame Josee codes h common h crc16 h debug h m7000 h Include m7k h The header of M 7000 series library modbus h msw h sio h slot h timer h The M 7000 ies lib libm7k a amp libm7k_usb a i ADAM dtu for x86 Linux PC The linux manual for M 7000 ies examnples dir Send Modbus protocol to get device getmodbus information Send Modbus protocol to set value to common setmodbus the device Get module name NetID and Modbus utility baudrate Linux M 7000
11. states of a module Please refer to Figure 3 19 Figure 3 19 3 20 Demo ao Demo ao is used to set single analog output channel value This demo set value 5000 to the device you should check type code and value range you can refer address mapping below link http www icodas com products Remote IO m 7000 address mapping m700 0 address mapping pdf Please refer to Figure3 20 Figure 3 20 Linux M 7000 User Manual Ver 1 0 Feb 2015 17 3 21 Demo ao readback Demo ao readback is used to read analog output channel value Thid demo read value from CHO CH1 Please refer to Figure 3 21 Figure 3 21 3 22 Demo ao set power on value Demo ao set power on value is used to set analog output channel power on value This demo is set analog output CHO power on value 2500 if print OK the setting is success Please refer to Figure 3 22 Figure 3 22 3 23 Demo modules name This demo is used to read aio device module name Please refer to Figure 3 23 Figure 3 23 Linux M 7000 User Manual Ver 1 0 Feb 2015 18 3 24 Demo multi ao Demo multi ao is used to set multiple analog output channel value This demo is set 5000 10000 7500 to CHO CH1 CH2 if print OK the setting is success Please refer to Figure 3 24 Figure 3 24 3 25 Demo read dev set This demo is used to read baud rate and data bit setting Please refer to Figure 3 25 Figure 3 25 3 26 Demo read protocol This demo is used
Download Pdf Manuals
Related Search
Related Contents
Coastdown Software Manual Clavier à codes radio NB404 GE AL10 Design Files Importing Information to the Program 1/3” Tag/Nachtkamera mit IR-Beleuchtung VKC Samsung AGE0104MB Manual de Usuario Toshiba 53AX61 53" Rear Projection Television Intl Integrated UCI.qxp:Intl Integrated UCI Copyright © All rights reserved.
Failed to retrieve file