LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Modbus and a CAL 3300 Temperature controller needed!!

Any progress made with this problem?

0 Kudos
Message 11 of 63
(1,721 Views)

it is very easy, please use attach file example code to run, i got the data is correct when conmunication with Cal-3300.

0 Kudos
Message 12 of 63
(1,644 Views)

OK, but how would you convert that into LabVIEW?

0 Kudos
Message 13 of 63
(1,631 Views)

Hi

 

I'm having the same problem as the first post in this thread. I know nothing of Modbus and very little on communication. I tried following the example in the article Introduction to Modbus, Getting started with Modbus in LabVIEW. I've attached the code with the error messages I've received.

 

Thanks in advance.

Download All
0 Kudos
Message 14 of 63
(1,547 Views)

Also attached is the CAL 3300 Communications Guide and screen shoots from Test and Automation Explorer.

0 Kudos
Message 15 of 63
(1,536 Views)
0 Kudos
Message 16 of 63
(1,535 Views)

You can always right click on an error code and select "explain error". This should give you a message that makes more sense.

 

For the visa error:

http://digital.ni.com/public.nsf/allkb/6807113B057FDE4C86256B41008212ED

check to make sure you don't have something else in the system already using the port. If MAX is modifying settings, it could count as that other program. Worst comes to worst you can restart your computer, which should kill any programs using the port.

 

The second error has this explanation:

"LabVIEW:  You configured this serial request as a broadcast. The Modbus slave does not respond to broadcasts. Contact National Instruments for technical support."

You selected a unit ID of 0 which is a broadcast request. Since you are expecting registers back, a broadcast address is not appropriate, hence the error.

 

 

Also, you'll want to confirm those port settings you've entered (none/none) with the device. Looks like the device has different options.

Message 17 of 63
(1,519 Views)

Oh and if you look at the modbus serial spec here (pg 12/44 http://www.modbus.org/docs/Modbus_over_serial_line_V1.pdf) you'll see your device does not meet the standard and will not work out-of-box with the code you showed above. If parity=none is selected, modbus serial devices must have 2 stop bits. Your device uses 1 and therefore does not match the specification. "Option 1" on your device should work fine.

 

This is documented here (http://zone.ni.com/reference/en-XX/help/370622M-01/lvmve/modbus_create_master_instance/) although ironically I just saw that the documentation is dead wrong on the other two cases. If odd or even is selected, the number of stop bits is 1, per the spec, but the documentation says it is 1.5. I'll file a bug report on that. 

 

You can always force-override any serial setting by using a property node on the port *after* initializing the modbus instance. In this case, between the "New Serial Master" VI and your while loop.

Message 18 of 63
(1,510 Views)

I changed the Unit ID of the device to 1. The program made it to the read function until an error was generted. I was trying to figure out the CAL communications guide and all the bites and bytes that needed to be sent back and forth. I think this might be too complicated for my abilities. I was hoping to read and write the Set point and read the temperature value from the controller. It might be easier to figure out a different way of doing this.

0 Kudos
Message 19 of 63
(1,504 Views)

I changed it to even and recieved error code 56 after the read function. It timed out. Of course I don't know a starting address and I think I read it can only read one register at a time. I changed the number of registers to one but got the same error..

0 Kudos
Message 20 of 63
(1,487 Views)