LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ModbusTCP I/O Server - What am I missing....

FYI: Total Newb
No Labview training (soon). No hardware to deploy to (cRIO will be the eventual target). In any case I wanted to at least get some comms working.
So I decided to try adding the Modbus I/O server to the 'My Computer' target in labview.
Specifically ModbusTCP...

Inverter:
ModbusTCP Slave (Server)
IP: 192.168.1.100
Subnet: 255.255.128.0
Write to inverter = holding registers 1-256 (MBTCP starting address = 400001)
Read from inverter = holding registers 257-512 (MBTCP starting address = 40257)

MyComputer:
ModbusTCP Master (Client)
IP: 192.168.11.199
Subnet: 255.255.128.0
Windows XP pro SP3

As I said, I added I/O Server to 'My Computer'. Left everything as default except: set from serial to Ethernet, and entered the IP address of the inverter. (which replies to pings from the pc). Next, I added some bound tags: two words, bit wise, into the inverter. 400001.1-16, and 400002.1-16. I dragged these into the block diagram, and made a toggle button to set 400001.1 and 400002.1. I configured the inverter appropriately and monitored the fieldbus inputs using the inverter software. I 'run' the VI continuous, and set a probe on my toggle switch, just to be sure it is changing state.

Inverter: Nothin'

So added some of the system variables for the I/O server. Update Rate, Update Now, Comm Fail, etc.. and created basic controls, to set or display these items as needed. Set update rate 1.0, .25, 2.0 etc...

Inverter: Nothin'

Next I opened Modbus Poll (Modbustools.com) and configured a Master (Client) and poked a 1 into 400001.

Inverter: There it is! - endianness is wrong, but I can fix that later.

So what am I doing wrong in Labview?
Where are the typical diagnostic things that Modbus spits out - the exception codes? Invalid address, Slave not found, unsupported function code, etc...?

 

Next, I installed labView on my home machine (Win 7 pro)...turns out I must install something else to get the Modbus I/O server working, so I will install NI-RIO, then real time then FPGA, (all the things I installed on my XP machine. And I will try again eliminating my XP machine as a culprit (although it works quite well with Modbuspoll).

 

Thanks in advance for any sage advice.

 

Edit: Is it possible that the I/O server tried to use my WiFi NIC instead of the RJ45 NIC? The inverter would be un reachable in that case. Will try again with WiFi disabled...

0 Kudos
Message 1 of 2
(2,145 Views)

Success. With integers anyway. Something about writing Booleans does not work. I can recall setting in our HMI software 'bit masked writes' that enabled them to write to certain slaves. In any case I can packup my bits before writing to inverter.

 

0 Kudos
Message 2 of 2
(2,137 Views)