03-02-2007 05:20 PM
I’m trying to write and read the registers in G3800xx016. controlling temperatures and lightning. Please look at the attached pdf file for this unit..
I have used Lookout for about three years, and it works fine.. Now I want to expand my system and try to use Labview 8.0
My temperature register start adress is 100 Hex (256 dec) I read from Register with Function code 03.
This register have values from 0-255 witch mean in labview for me as unsigned byte U8
I read my temperature from the register like this: eks.: 40257 lets say value=5
Slave FC Start Adress Byte Value CRC
01 03 0100 02 0005 7847
This is the status received from the Modbus tester when I use null-modem connection..
I receive the same value if I use Modscan32
I have used null-modem cable to read out the values.
I have also PIR detectors that control movements and light of and on, and I read these starts at 40017.1
01 03 0010 02
The register to switch on and of heating and lights starts at 404097.1 FC16
Values mention here is read from Lookout 5.0
I have tried examples and read for weeks about this, but everything stops when I try to use Labview 8.0 I can’t read any values from my Master unit, neither write to it, or read any values in Modbus testers when I use null-modem cable.. I have tried different baud rates in my serial connection and it works perfect in Lookout, but Not Labview..
I have even bought DSC module, but I can’t write to either com ports or Modbus testers..
Please anybody… is there anybody that can give me help with this??
Start address for for PIR detectors is 40017.1 (FC03) and for writing bits for on of to light and heatsystem is 404097.1 (FC16)
I would be very happy for any idea that can give me some positive results… Look at the attached pdf file.
Thanks.. and very best regards from
Benjii…
03-03-2007 05:06 AM
Have you downloaded the NI modbus library??
http://sine.ni.com/nips/cds/view/p/lang/en/nid/201711
Also try my modbus serial query.llb in reply 10 of this thread.
http://forums.ni.com/ni/board/message?board.id=170&message.id=200988&requireLogin=False
03-05-2007 05:05 AM
03-05-2007 06:52 AM
I had a difficult time with modbus in the past but always got it working with labview. The biggest problem I have encountered with that the settings for the serial port are often not correct. Make sure that device and the serial init function are matching in baud (very important often the cause of troubles), start bits , stop bits, parity.... I would start very simple, open visa followed by a init serial command (set all settings explicitly to match your device), send a visa write, wait (1 second for now) then issue a serial read. The string to write and read can be selected to be hex strings and the value send can be the example from the device manual. This will be the simplist verification of a correct communication protocol. I have never had any luck with generic modbus drivers but I have easily written several using visa. Good luck.
Paul
03-05-2007 06:56 AM
One other stumbling block I had in the past. Often a device comes with its own application for communicating with the device. Make sure this is not opened since it will grab your com port and labview/visa will not be able to use it for communications.
Paul
03-05-2007 07:01 AM
03-05-2007 07:07 AM
03-05-2007 07:08 AM
Hi again Paul...
You wrote me this.:
""One other stumbling block I had in the past. Often a device comes with its own application for communicating with the device. Make sure this is not opened since it will grab your com port and labview/visa will not be able to use it for communications.""
I think this is what happens here.. cause when I tried to view what is going on on the com port, I always get the message: The com port is already open.. and I can't communicate, even if I have restarted my computer. So my problem here will be how to find the application that controle this, and to deactivate it.. I will try.. but if you have any idea, I would be happy to have this answer as well.... I use Lookout 5.1.. and maybe there is an application there that controle and lock the com port... I don't know..
Thanks again.. rgards from Benjii...
03-05-2007 08:21 AM
03-05-2007 08:23 AM
Hi again Paul...
I didn't understand exactly what you meant about any application that was open, but it's obvious to me now..
There is no application that use the com port after I shut down the system, I removed Lookout from the startup section in my computer.. So when I have restarted my computer it should be ok.. But still.. I can remember that the message was: com port is already open.. Maybe it was because the comport was connected to my Mastergenerator, and that I have to reconnect it to release the com port.. I will try.. I learn a lot of this... but it's very time demanding.. but I never give up..
Thanks again Paul... Benjii..