01-15-2014 01:39 PM - edited 01-15-2014 01:56 PM
Running an app that uses a couple serial devices. One is a stepper drive that is controlled by simply sending command strings to the drive controller via serial connection.
Have had to update to Win 7 (from XP) and as well upgraded to LV 2013. Now all of the sudden I get errors from the vi that writes to the serial port. Sometimes it goes for a couple hours before popping up, sometimes 15 minutes. There is not even much consistency as to which iteration of the vi pops the error. I have added delays here and there, put a delay in the write vi (attached), added a clear buffer before the write, etc, etc. This bug will not go away. this is the error that pops up..
I have attached the vi. It is about as simple as they come which is why I am pulling what little hair I have left out. Two changes in this version from the original that ran forver on the XP system, the 150 ms delay between Write and Close (since increased to 400) and I have also changed the timeout on the Configure from 10000 ms to 5000 ms (10 sec to 5 sec).
Once this happens then all serial connection with the computer is hosed and I have to reboot the system to get going again. The computer, a relatively new dell, has one built ini serial and I am using a StarTech expansion card for two additional ports. (2 Port PCIe RS232 w/ 16550 UART)
ANY help is much appreciated on this as having to go reset the system 10-15 times a day is killing me.
Solved! Go to Solution.
01-15-2014 02:50 PM
There is not much information provided in the VI you attached so I will try to guess.
I suppose this VI is in a loop and is use to send repetitve commands to the unit. If so the Configure serial port and VISA Close functions should be respectively before and after the loop. Only the Write command should be in the loop. It doesn't make sense to open and close the serial port every time you're sending a command.
Ben64
01-15-2014 03:18 PM - edited 01-15-2014 03:19 PM
Give Ben(64) an honorary 8-Ball!
Ben's(Raynard) famous Action Engine Nugget is always a good read. http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801
An AE with an enum <Null, Init, Write, Read, and Close (Optionally, a nirvana type "Query" calling "Write", delay, "Read" )> would go a long way!
01-15-2014 03:23 PM
It only gets called when a stepper move is required. It is not in a loop. The main app is for an assy operation. The vi is called to perform a stepper move. Several other steps occur and if required, it is called again. This can go on for 5 to 15 iterations and is in a state machine. When the assy process is done, it makes one more call to return the stepper to home. That is the longest string that is ever sent as shown below.
CC1.3\rMR13\rAC100\rDE314\rVE4\rDI-1\rSH4F\rDI21609\rFL\rCI0\r
Not sure what other information I can provide. I have since the first post, added a 100ms selay between the Clear Buffer and Write command and also turned the Enable Termination Character to True (it still functions but was just done within the past 10 minutes so not sure if it is going to help in the long term)
01-15-2014 03:27 PM
I can implement and AE structure and see if that changes anything. The only thing I do on this device is write string commands. No reads or anything else so the AE would only have Init, Write and Close. Seems a bit overkill for this but I am willing to try anything to remove the error. Will be tomorrow before I can try it. Will do it first thing and advise on results.
Any other thoughts in the meantime are welcome.
01-15-2014 03:28 PM