05-26-2009 02:08 PM
05-26-2009 02:30 PM
Your second VI has no block diagram, thus I couldn't load it.
Your first VI doesn't have much going on in it, and we don't have those global variables. So there really isn't any help we can give until we get more details on what your issue is.
05-27-2009 04:15 AM
05-27-2009 08:30 AM
05-27-2009 12:52 PM - edited 05-27-2009 12:54 PM
Just start with the MB Serial Master Example available in the NI VI's for download.
Does the device have any software it provides to communicate with it? If so, make sure you can communicate using that. Baud rate, parity,stop bits, using null modem vs. straight through cable, are all important. Know what the slave address number is assigned for that device. See if there are any settings you program through the front panel of the device to determine the communication method. It might have different options like ANSI, RTU, other proprietary methods.
Read the communication manual that it has. Register numbers, command codes are important.
Do this with the NI VI. Don't mess with any global variables yet. So far with what you've posted (and some VI's still aren't able to be opened), I don't see any reason to break up the VI's and use global variables yet.
If you run into issues, post that VI along with any error messages (including error numbers) that you may get.
PS. Keep the communication in one thread, this one since it is your original and has most of the information.
05-27-2009 01:47 PM
05-27-2009 02:03 PM
I have attached a BMP to show the (5 ) globals that are in the Modbus VI. Numeric 1,2,3 are OK. It is the DATA "in blue" and the REGISTER "in purple". I am having problems withe data and the register.
Thanks
Philip
05-27-2009 02:38 PM
You're 3 numerics should be U16, U16, and U8 respectively to eliminate the coercion dots. They should have more descriptive names than numeric. Rather than having different variables for each, make the cluster the only variable in the global variable.
You still haven't explained what problems you are having iwth the data and the registers. What registers are you trying to read/write to? Do you have a copy of the communications manual you can post or link to? Save your VI with the actual data you are trying to use saved as defaults so we can see how you are setting them up.
Rather than worrying about writing, just start with trying to read a valid register to begin with.
05-27-2009 02:54 PM
I can set the values and read back by manualy setting the "Write to Register, etc" by passing a numeric value. Type the value in the modbus VI.
I am trying to send global varibles from my GUI to set the temperature and then monitor the temperature on a strip chart recorder. Read temperature is 300. Section 7.2 communications is the part on the modbus registers.
Thanks
Philip
05-27-2009 03:14 PM
So your modbus communication is working correctly?
I'm not sure which VI is your GUI. Or how the MB Interface Choice vs. Temperature System Demo fit together. Or how the Globals tangle things up. Or how temperature status fits in.
Which VI is your main front panel?