LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial driver keeps crashing almost at random.

I’m not sure if the Chroma 6460 or the labview drivers.

 

The setup is pretty basic I have my laptop connected to a NI 4 port RS232 to USB and then with a null cable to the AC power supply.  My issue seems to be sporadic, error -1073807346.

 

I just saw this article and I’m going to try it tomorrow but I don’t have high hopes

 

“VISA Error -1073807346 When Opening a VISA Session in LabVIEW”

 

The base program is very simple program voltage and frequency; and then read/log voltage, current, frequency.

0 Kudos
Message 1 of 6
(3,194 Views)
Are you selecting the com port from the the VISA Resource pull-down menu?
0 Kudos
Message 2 of 6
(3,174 Views)

Yes, i do pull form a pull down.

 

Here is a copy of the code. I apologize for the half hazard way its put together but this is just scratch code to place in a larger section of code.

 

At one point yesterday I thought it may be a timing issue so I did try to add wait timers in between sections. I did look into the driver code and some of the read commands have a higher byte count than they need. The driver does have stop bits in place so that should not be a problem but I did try to change that at one point.

 

On the actual device, I do get “Data format error” every so often and it does collate to the drop out. It happens some of the time but not all the time and I have tied resetting the device to see if that changes anything and it doesn’t seem to.

0 Kudos
Message 3 of 6
(3,153 Views)

Ok so I’ve made some serious progress on this.

 

First I cut the time out error down from 2 seconds to 0.2 seconds this really helped.

 

Second I call each of the commands in a separate loop iteration paging through them with a case structure. This seems to work amazingly well, and has greatly improved stability.

 

Third I slowed down the communication rate from 19200 to 9600 and I'm in the middle of that test now.

 

It runs for 18 minutes before a communication failure occurs and the communication is out for about 125 seconds. This is much better than it was this morning, but I need it better. It faults every 18 or 20 minutes for exactly 125 seconds.

 

I can live with up to 10-20 seconds of failure but anything higher than 15s can start throwing off a test. I can sense when I loose communication. So if there is a to reset the visa to get communication back up quicker I could implement that.

 

The other practical solution is to have it run for 40 minutes without failure.  I'm going to try to reduce the baud rate tommarow and see if that helps.

0 Kudos
Message 4 of 6
(3,119 Views)

Without the Chroma drivers it is impossible to tell what is going on in your VI.

 

It appears that you may be opening and closing the VISA session in each iteration of the loop. That is generally bad practice and may be contributing to your problems. Try moving the Configuration VI before the loop and the Close to after the loop.

 

Lynn

0 Kudos
Message 5 of 6
(3,103 Views)

I’ll try that too, one of the problems or thoughts I had a few days ago was ‘May be it will work more consistently if I opened and closed every iteration’ as it was locking up the port after I exited the program.

 

I did use the Chroma drivers at first I just kept getting errors with them.  So I just opened them took what I needed as a bare bones approach and started running it till it was consistent.  Labview would start running than pause and flash at a node and I would have to stop the run and close out the program and reopen.

 

I could put the drivers back in without too much hassle, as what I have in there is what’s in the driver without the measure vs stored data switch.

0 Kudos
Message 6 of 6
(3,092 Views)