LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Ethernet

Hi,
I've been through the tutorials and examples and the forums and still cannot figure this out.
I'm trying to communicate with the CMore via ethernet.
 
Hardware:
PC, WinXP, Labview 8.5, Labview RT module (haven't used yet or programmed anything for it yet)...DO NOT want to have to purchase DSC module
PXI Controller with several boards (not trying to talk to that yet, not even hooked up, will be IP 130.151.217.3)
AutomationDirect CMore touch panel display (new version of the older EZ TouchPanel)
Network Hub (PC address 130.151.217.4, CMore address 130.151.217.5)
 
I followed the examples and tutorials and tried to setup first a "Server" and then a "Client", following the examples and setting the IP address in the Server to 127.0.0.1 (supposed to be the host computer), ran everything and saw nothing happen between the two Server and Client VI's created, which were very simple; a pushbutton and an indicator so I could see which way the communication was going.
 
I then modified the "Server" for IP address 130.151.217.5 (the CMore) and ran just that VI (closed out the Client VI and project). Again, nothing happened.
 
I have the two variables on the CMore panel addressed correctly (using 165534 for a pushbutton and 165535 for an indicator). I started at the high end because when I tried entering the address, the leading 0 was cutoff and I wanted to eliminate the possiblity that this was the problem.
 
Questions:
-- I'm not sure what is the "Server" or the "Client"...the CMore will be where the operator enters variables and turns items on/off
-- The program will eventually be in the RT module...no PC will be attached
 
I just need a little direction for what I'm trying to do. I'm not understanding the difference of who is the server and who is the client...you only set a "port" number when you configure the client. How will I talk to the PXI? When I started this project my thoughts (obviously incorrect) was that all 3 items would have an IP address and then they can "talk" to each other...the operator hits "ON" for a switch on the CMore, the Labview program reads this, turns on a relay through the PXI and sets an indicator ON on the CMore.
 
I've attached my CMore settings (found in a forum that the Modicon Modbus protocol was what to use...everything else is very specific to a PLC) and the two little projects and VI's I created.
 
Any hint or suggestion would be very much appreciated!
Thanks.
 
 
Download All
0 Kudos
Message 1 of 19
(10,452 Views)
 

task,

I found some information about issue.  Connect two computers using modbus TCP/IP   , Using Touch Screens with LabVIEW through Modbus Serial - Example VIs , and Creating Modbus I/O Servers .

I have some additional questions:

1.  Have you installed the Modbus LabVIEW Library?
2.  What examples did you start with?
3.  Is this the tutorial you began with?
4.  If you have the Modbus LabVIEW Library installed, are you using those VI's as examples?
5.  Are you communicating with Lookout/Lookout Protocol drivers?



 

A_Ryan
AES
National Instruments
0 Kudos
Message 2 of 19
(10,364 Views)

task,

Just to clarify in order to communicate you will need the IP address of the device you are communicating with.  For instance if the CMode touch panel is the master, and the PC is the slave.  In the I/O server the CMode touch panel will need the IP address for the PC, and the PC will need the IP address for the CMode in order to communicate with each other.

A_Ryan
AES
National Instruments
0 Kudos
Message 3 of 19
(10,348 Views)

Thanks for the response. I will look at the info later tonight.

Answers to your questions:

1,2,4:  Yes, installed and examples followed. Do not have (or want) DSC Module so those examples are blocked out.

3: Yes

5. No, have never used lookout...if it's another module or cannot be used with Labview RT then I cannot use it.

Thanks again and I will follow up with any progress I have after reviewing the new info provided.

Teri

0 Kudos
Message 4 of 19
(10,344 Views)

Sorry, didn't read the next post or I would have included this response also.

Yes, I have all the IP addresses set up accordingly (top portion of my post). I'm still confused on the Server, Client issue but I have the CMore setup as the Master and the PC as the Slave. I haven't even brought the PXI box into the picture, which I believe will be another Slave.

Thanks again,

Teri

0 Kudos
Message 5 of 19
(10,343 Views)
I believe the master device should be the one with the data inside it. The Cmore should be a slave trying to read data from the RT device that acts like a master. Any HMI device should be a slave.
0 Kudos
Message 6 of 19
(10,283 Views)
Thanks for the reply unclebump.
See, this is why I'm confused...all three items on the network will be reading and writing data to each other; so does it matter which one is the Master?
 
Scenario:
Labview RT will reside in the PXI controller and will be reading data from the PXI boards (analog, digital, CAN, GPIB) and also sending data to these cards to control stuff (temperature controller, analog outputs). Meanwhile, the CMore will read input from the operator (voltage settings, on/off control of items) and accept updates from the Labview RT (indicators and measurement readings).
 
Right now I don't even have the PXI controller in the picture, just a PC and the CMore. I've tried making either one the Master to no avail. I know I'm probably missing something simple!
 
Thanks,
Teri
0 Kudos
Message 7 of 19
(10,254 Views)

"I believe the master device should be the one with the data inside it" - unclebump

 

I think this is not true. i think it is not the data which is determining factor in master slave communication. but who CONTROLS the communication.

you are confusing between master slave and client server.

and contrary to your belief many a times server is slave and client is master.

when you connnect to internet; servers dont ask you "would you like to see this site?" but you (client) tell to the server "show me this site"

when you communicate with GPIB instruments or modbus devices etc. the devices have the data and they inherently act as slaves.

 

" The Cmore should be a slave trying to read data from the RT device that acts like a master" - unclebump

i agree that Cmore should be slave, not because it is trying to read data from RT.  It should be slave because we want to control the state of Cmore from RT



Message Edited by Tushar Jambhekar on 01-21-2008 03:03 AM

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 8 of 19
(10,043 Views)
Hello task,

You do not need the DSC module to run the MODBUS example that comes with the library.  These examples are located on the function palette with the other MODBUS vi's.  There are examples for ethernet.



Would it be possible to add a link to the product manual for the CMore?


Message Edited by O_Proulx on 01-22-2008 06:29 PM
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 9 of 19
(9,733 Views)

I have tried ALL examples...the ones provided by NI and others I found in other forums. What I need is a detailed explanation of how to set it up. All the examples show how to use the modbus on one computer, each program talking to each other. Obviously I can do that. I'm just getting ready to try communications with my PXI system since I just got it all set up. Eventually the PXI-8184RT will all that will be in the picture along with my CMore but I should be able to get somewhere communicating between the PC and the PXI. I really need to get the CMore working so hopefully if I get the PXI to communicate I can go from there...you'd hope!

Thanks for the continuing help.

Teri

0 Kudos
Message 10 of 19
(9,600 Views)