LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cFP-180x Modbus not working

 
I have recently bought a compact FieldPoint system that consist of a cFP-1804 and a cFP-DI-301.
I want to talk to it from my cRIO.
I downloaded the NI library "nimodbus" and read the help file "Using the cFP-180x as a Modbus Device". From the "nimodbus" library I'm using "MB Ethernet master Query.vi". In this vi there is a control that consist of five controls: "Function Code", "Starting address", "Quantity", "Data" and "Discrete".
 
I'm using the 'Read Coil' command, and the address accepts only 4 digits, not he 5 stated in the help fiiles. So I'm using address 1001 to read the first bit on the DI-301.
I did not put anything in the Data or Discrete controls.
 
I'm not sure what to do with the MBAP header.
 
When I run it, I get an error 63, connection refused. I am using port 502.
Is there an example of reading cFP from Modbus Ethernet anywhere?
0 Kudos
Message 1 of 11
(4,060 Views)
Hi,

Here is an example that I found on our Developer Zone:

ModBus cFP-180x

Also, do you have the correct firmware version (6.0.5), as described in the following KnowledgeBase article?

Where Can I Find the Documentation for using Modbus with the cFP-180x?

Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 2 of 11
(4,042 Views)

Thanks, but this uses the vi that I referenced above, the one that will not work.

-NSK

0 Kudos
Message 3 of 11
(4,030 Views)

Have you networked your FieldPoint appropriately, according to this KnowledgeBase article?

Also, this article might be helpful with your troubleshooting efforts.

Error 63 sometimes occurs when the IP address you are using is already in use by another PC or piece of hardware. Have you tried pinging the controller?

Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 4 of 11
(4,010 Views)

Thanks. All of these articles deal with setting up the FieldPoint. It already works under MAX; the settings are fine. It just won't let me open a TCP/IP connection to it from Labview

-n

0 Kudos
Message 5 of 11
(3,998 Views)

I connected an RS-232 terminal (that abandoned TPC-2012 touch panel, good for something after all) to the cFP, booted it up, and saw this message:

"Attached TCP/IP interface to motfec unit 0"

So, do I need to get motfec'd again, or what?

-n

 

 

0 Kudos
Message 6 of 11
(3,992 Views)

OK, motfec is a VxWorks thang. The local NI rep was just here looking at this, & he offered this thought:

 Since the FieldPoint connection is refused, and since the Modbus shared variable connected to it returns empty data, could it be that the server is just not cranked up?

This is a brand new cFP-1804; I don't think it need a firmware upgrade to handle Modbus, so I don't know why this should be the case, but I have no other ideas.

-n

0 Kudos
Message 7 of 11
(3,981 Views)
Hi,

I have a few suggestions for you.

Let's try using just FieldPoint to communicate with your PC via Modbus before communicating with the cRIO. Also, which address are you sending in the coil? You'll want to send 1 instead of the default value of 1000 or 1001. Choose the address and then input the registry number.

Are you using LabVIEW RT? If so, you can easily create local variables with Modbus. Alternatively, you can bind shared variables to a Modbus data item.

I took a look at the example on our website that you are using. You might want to increase the wait time for the program to run more efficiently.

I hope this helps!
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 8 of 11
(3,965 Views)

I tried moving the vi in the project from the cRIO to the computer, but it still won't accept a connection (error 63), so the cRIO is not the problem.

I also bypassed the ethernet switch & hooed up directly via a cross cable. No help.

 

So then I tried creating a Modbus shared variable.

I get 'empty data' using that shared variable. Not sure about the address - the '1001' looks correct, but what numbers come before it in the address?

Am I reading a coil (101001), a discrete input(201001), an input register(301001)?

I tried various combinations, but got no data. I emailed NI support about this, but they just pointed me to an app note. RTFM 😞 

 I emailed back ,asking for clarification, no response from support. I don't think many people there in support have experience in this area.

I do. Five years ago, I wrote my own Modbus driver to talk to a Wago PLC.  Never saw error 63.

If I can ping the cFP, but can't open a connection to it, can the problem still lie in my PC? Firewall is off.

Are there other tests I can do? Can I somehow try to open a connection to the cRIO?

0 Kudos
Message 9 of 11
(3,961 Views)
Hi,

What was your service request number that you created your email request on? I'll see if I can track it down and work with that engineer on this issue.

You mentioned that you can ping the FieldPoint controller. Are you unable to connect to your FieldPoint in LabVIEW or MAX? Disabling the firewall (as you mentioned) is helpful, as well as disabling any virus scan software you may have.
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 10 of 11
(3,926 Views)