08-04-2011 12:58 AM
Hello all,
I need to use NI PCI-8432/2 to talk to AnyBus gateway module ( a modbus to profibus gateway) so that the PC can communicate with Siemens S7-1200.
I downloaded Modbus library in Labview from NI, not sure how to use it.
1. I try to use PC as master to send a real number setpoint value to the PLC, shall I use the MB Ethernet Master Example.vi only? If so, I should use the PLC IP as the IP address, what is the Port number to use in Labview?
2. I also need to read the real process variable from the sensor, it is also a real number, from the examples, it only has U16 register type, how to send real and read real number?
3. There are Master and Slave examples for both Ethernet or Serial, for my application, do I just only need the master example like code?
Thank you in advance,
Kimberly
08-04-2011 04:25 AM - edited 08-04-2011 04:32 AM
Hi,
First try to find out S7-1200 communication modes. Selection of the RTU slave or Ethernet slave completely based on your ModBUS Slave property.
As I know there is no Siemens PLC available in the market with direct ModBUS interface. So first to communicate with the PLC you have to programmer your PLC. You should set all initial setting in your program to communicate on ModBUS like Device ID, Baud Rate, Parity, Data Bit, Stop Bit. You must configure all the register address according to your data.
Now once you configure your register address for data or all initial ModBUS settings you can easily communicate with your PLC.
Port No. is nothing but the Port of your PC, that you are using to communicate with the PLC.
Thanks and Regards
Himanshu Goyal
08-04-2011 10:52 AM
Himanshu,
Thank you for your instruction. I saw the NI Modbus.llb attached, is the the same as the one on NI website? I downloaded that one and used the readme file to add them in the user library already.
I will talk to the PLC programmer and find out the settings.
Kimberly
08-04-2011 06:13 PM
I have a question on how to give the address to the subvis in the Modbus library.
For example, I want to write a setpoint 90.3 to a holding register. In Modbus the address is 40001, do I need to give the starting address as 1 instead of 40001 in the Writing subvi? I figure that since we choose to Write Multiple Registers as the Poly VI, we only need to give the address as the offset part from 40000.
Please see attached vi.
Thanks,
Kimberly
08-04-2011 09:32 PM
You may have to give the address as zero.
Modbus registers generally start at 1 while in the data protocol they start at 0.
Look at http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf page 8.