LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intermitent VISA Write error - Pulling hair out

Solved!
Go to solution

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..

 

LV_Visa_Error.png

 

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.

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 1 of 28
(3,692 Views)

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

Message 2 of 28
(3,676 Views)

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!


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 28
(3,667 Views)

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)

 

 

 

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 4 of 28
(3,662 Views)

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.

 

 

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 5 of 28
(3,655 Views)
The Configure Serial Port should only be called once and you are saying it is called multiple times.

You also have not provided the error number or message that you get. Essential information that is missing.
0 Kudos
Message 6 of 28