04-26-2010 07:54 PM
Hi,
I would like to test the master server modbus serial communication running on CRIO (9012) and slave server modbus serial communication.
Questions:
Is it possible? Run two VI the same time? If yes, what i am doing wrong
The CRIO is connected by ethernet and by serial with PC.
Best Regards
Solved! Go to Solution.
04-26-2010 08:55 PM
Yes you can run two VI's at the same time. But you have several problems.
Your top VI has no connection whatsoever to your bottom VI. It is just a random number generator connected to an indicator. But that indicator will always show zero because it is set up for an integer. The random number generator puts out a value from 0 to just under 1. It will always round down to 0 when you coerce it into an integer.
Your real modbus reading problem is in your lower VI. There is no way to tell what is going wrong by a screenshot.
04-27-2010 08:28 AM
Hi Dfiorillo,
Not so long ago i wrote an application using Modbus. I downloaded a freeware piece of software off the internet that was really usefull. It allowed you to simulate a modbus slave. You could designate address and registers. Unfortunately it was on my laptop which i have recently changed operating system on and have lost. Im sure that if you have a look you will find something suitable.
Rgs,
Lucither
04-28-2010 04:18 PM
Ravens,
How could I exchange modbus' data between two VIs? One emulanting a master and the other emulating a slave? The slave will run in the PC and the Master will be deployed in the CRIO (9012). Folow the files in attachment
Best Regards
04-28-2010 04:53 PM
Lucither,
I will try the Simply modbus slave in http:/www.simplymodbus.ca/RTUslavemanual2.htm, just to make a test.
Thanks
04-28-2010 09:09 PM
dfiorillo wrote:Ravens,
How could I exchange modbus' data between two VIs?
How about a regular network based shared variable?
04-29-2010 01:52 PM
Ravens,
Ok. I need to make sure that the master serial modbus IO server which running in CRIO is communicating with the VI slave modbus which will running in the PC. What do I do?
Change the indicators to the shared variables???
04-29-2010 10:41 PM
Indicators are not the same things as shared variables. Shared variables are items stored in a library that multiple VI's, even between systems can access. An indicator is just a front panel display a value that only exists in the context of the VI.
Host a shared variable library on one system. Have the VI on one system write to that shared variable. Have the VI on the other system read the shared variable and write it to the terminal of the indicator.
You can actually take a shortcut. On your front panel display on your PC, instead of using a shared variable in code that is wired to the indicator, you can use front panel binding for the indicator. If you right click on the indicator and go to the data binding tab, you can associate that indicator with a shared variable that is a part of a library that is hosted either on that same computer, or on a different computer or target. When you do it, a little triangular status LED will show up next to the indicator.
05-03-2010 01:18 PM
05-03-2010 04:56 PM
Reavens,
I made the test of communication between CRIO and PC via MAX, and worked. The commands were requested from CRIO via TCP/IP, and received, in the PC, via serial. Now, it is just missing to make the VI modbus server works. What does the 1967353902 error means?