FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus address problem

Dear All
 
I have recently bought a compact FieldPoint system that consist of a cFP-1808 and a cFP-AI-118. I'm getting the system to work in Windows by using express Fieldpoint vias, but I have a requirement to have a Linux version (a embedded computer will control the system) so I have started to looking at Modbus. 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".
According the help file "Using the cFP-180x as a Modbus Device" and page "FieldPoint Modbus Addresses", the address should start with '0' for raw I/O data. Since my analog input module is at slot '1'and I want to read channel 1, the address should be '01001'. But when I try to type this address in "Starting address" control it gets 'converted' to '1001' and during the run of the program  I obtain the error code "MODBUS Exception code: 2." which means that my address is incorrect. But when I'm reading the attributes (according the help file It stats with '1', therefore my address is '11001'), I have no problems.
So please explain for me what I'm doing wrong with the address for reading the raw I/O data.
 
Best Regards
Magnus Svensson

Message Edited by Magnus Svensson on 03-30-2006 08:15 AM

Message Edited by Magnus Svensson on 03-30-2006 08:15 AM

0 Kudos
Message 1 of 6
(4,410 Views)
Magnus,
 
I am assuming you have tried Function Code 4, Read Input Registers, right? 
 
I am not sure how FieldPoint is doing the mapping, but since the FieldPoint address is a fixed, 5-digit, number, one would think it would be smart enough to assume a 4-digit address to mean a raw-value request, i.e., a MSB of 0. 
 
-Khalid
0 Kudos
Message 2 of 6
(4,395 Views)

Yes. When I read the attributes I'm using the Function Code 4, Read Input Registers. But since I want to read the data at my analog input channel I am using Function Code 1, Read Coils.

Best Regards

Magnus Svensson

 

 

0 Kudos
Message 3 of 6
(4,389 Views)

Magnus,

Actually, you should be using Fn Code 4, Read Input Registers, for your Analog Inputs as well.  Because these are numeric values. 

Coils are discrete (boolean) values, which you would use with Digital modules. 

Regards,

-Khalid

0 Kudos
Message 4 of 6
(4,387 Views)

Ahh...Now It works Smiley Happy

Thanks Khalid for your help. Since I'm new to modbus I assumed that coils meant Analog Input but apperatly I was wrong.

Do you know where I can found what the different fuctions stand for?

Best Regards

Magnus Svensson

 

0 Kudos
Message 5 of 6
(4,384 Views)

Magnus,

No problem...  "Coils" is an old terminology; usually implying closing/opening of solenoid coils. 

Here's the Modbus standard -- a good overview:

http://modbus.org/docs/Modbus_Application_Protocol_V1_1a.pdf

The website www.modbus.org has other stuff as well.

Regards,

-Khalid 

 

 

0 Kudos
Message 6 of 6
(4,374 Views)