03-20-2009 09:40 PM
I have been working on a project were I was doing simple serial communication via the serial port on my laptop. I needed to control some solenoid valves with the serial pump so I hooked up a cFP-2110 controller with a relay module and was hosting the vi's on my laptop. The serial communication worked fine. I wanted to clean things up and move the serial communication to the cFP-2110 controller and host the vi's on the real-time target. When I moved the vi to deploy on the target, the serial communication stop working. I went back to the modified version of the simple serial example from LabView help, deployed it to the target and I could communicate to initialize the pump with it connected to the cFP-2110 controller. Why does the vi work with the serial port on the computer but not when deployed on the controller? I can see both the serial ports on the controller in max.
Thank you.
03-21-2009 11:58 AM
03-23-2009 07:06 AM
It looks like I have all the drivers in place. I went back and modified the simple serial write and used shared variables between the host and the target so I could enter a string on the host and send it to the cFP-2110 target. I can send a string to initalize the instrument and send it short string commands and it communicates like everythign is happy. But If I try to send it more than a very simple string command the pump starts to move than stops, like it didn't receive all the command. If I take the same string and connect the serial cable back to the laptop and enter it in example simple visa serial write, it completes the entire command. I'm assuming it's a timing problem but can't figure it out. Any ideas to fix the problem?
03-23-2009 08:33 AM
Where does the serial communication come into play in your VI's? All I see are a couple of shared variables and a missing subVI called "support - acquire data".
03-23-2009 09:06 AM
danny,
It sounds like you are losing part of the long string. I would suggest taking closer look at how the buffering is configured for your shared network variable.
03-23-2009 11:08 AM
Ravens Fan, sorry, I pulled the VI's from the wrong folder to post. Here they the correct vi's. I just wanted a simple string program to test out the cavro pump and to make sure the serial port on the cFP was working correctly, Wayne.C., I went to the shared variable for the string and turned on the buffer and set the Buffer number of strings to 1 and the characters per string to 100. After doing this everything seems to work as expected. Does this sound like the correct way to fix the problem? Is there a downside to say setting the characters per string to say 1000 instead of 100?
Thank you for the help.
03-23-2009 11:14 AM
Danny,
This should be the way to fix the problem. I wouldn't make the buffer much larger than it needs to be. Probably ok to give your self a little room to grow, but don't go overboard.