DM myanalog[4]
3. Send the appropriate MB command. Use function code 4 (as specified per the PLC). Start at address 40006.
Retrieve 4 modbus registers (2 modbus registers per 1 analog input, as specified by the PLC)
MBB=,4,40006,4,myanalog[]
Results:
Array elements 0 and 1 will make up the 32 bit floating point value for analog input 3 on the PLC and array
elements 2 and 3 will combine for the value of analog input 4.
myanalog[0]=16412=0x401C
myanalog[1]=52429=0xCCCD
myanalog[2]=49347=0xC0C3
myanalog[3]=13107=0x3333
Analog input 3 = 0x401CCCCD = 2.45V
Analog input 4 = 0xC0C33333 = -6.1V
Example #3
DMC-4040 connected as a Modbus master to a hydraulic pump. The DMC-4040 will set the pump pressure by
writing to an analog output on the pump located at Modbus address 30000 and consisting of 2 Modbus registers
forming a 32 bit floating point value.
1. Begin by opening a connection to the pump which has an IP address of 192.168.1.100 in our example
IHB=192,168,1,100<502
2. Dimension and fill an array with values that will be written to the PLC
DM pump[2]
pump[0]=16531=0x4093
pump[1]=13107=0x3333
3. Send the appropriate MB command. Use function code 16. Start at address 30000 and write to 2 registers
using the data in the array pump[]
MBB=,16,30000,2,pump[]
Results:
Analog output will be set to 0x40933333 which is 4.6V
To view an example procedure for communicating with an OPTO-22 rack, refer to Example- Communicating with
OPTO-22 SNAP-B3000-ENET in the Appendices.
Data Record
The DMC-40x0 can provide a block of status information with the use of a single command, QR. This command,
along with the QZ command can be very useful for accessing complete controller status. The QR command will
return 4 bytes of header information and specific blocks of information as specified by the command arguments:
QR ABCDEFGHST
Each argument corresponds to a block of information according to the Data Record Map below. If no argument is
given, the entire data record map will be returned. Note that the data record size will depend on the number of axes.
Chapter 4 Software Tools and Communication
•
55
DMC-40x0 User Manual
Содержание DMC-4040
Страница 17: ...DMC 4080 Layout Figure 2 2 Outline of the of the DMC 4080 DMC 40x0 User Manual Chapter 2 Getting Started 8...
Страница 19: ...DMC 4040 Dimensions Figure 2 5 Dimensions of DMC 4040 DMC 40x0 User Manual Chapter 2 Getting Started 10...
Страница 20: ...DMC 4080 Dimensions Figure 2 6 Dimensions of DMC 4080 Chapter 2 Getting Started 11 DMC 40x0 User Manual...
Страница 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Страница 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Страница 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Страница 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Страница 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Страница 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Страница 220: ...Step 2 Remove ICM For DMC 4040 Proceed to Step 3 Configure Circuit Appendices 211 DMC 40x0 User Manual...
Страница 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Страница 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...