Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Consort EV232 power supply via RS-232

Solved!
Go to solution

Glad it looks like what you want.  I would suggest creating a new project and adding the JKI state machine and messing around with it a little bit.  When you see how it looks out of the box you will see that I only added some handlers for the front buttons and some cases to handle the sequences.  

 

Good luck to you on your LabView journey. 

Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 21 of 28
(3,332 Views)

Thanks again, Grant_LECO, that's just what I was intending to do. I'll probably get back to you in a while.

 

Another day, another problem: I've built this small code to test the measurement acquiring of the power supply. I use the code sent from the VISA Read to extract the value of the voltage and I plot it against time. Seems to work fine, but from time to time, I get a timeout error (I placed the Error Handler to tell me what's going on) and of course, the voltage read drops zo zero (as you can see in the graph in the lower left). This happens randomly. I'm pretty sure that the voltage itself doesn't drop to zero but that there's simply no code being returned from the power supply. Can anybody tell me why this is? This doesn't seem to have any influence on the running VI and I'm guessing it's something inherent to the power supply. So does anybody have any suggestions as how to go about acting as if there wasn't any answer that's supposed to come? To just skip the read and wait for the next one? (of course, I'd prefer to solve the problem instead)

 

Code

0 Kudos
Message 22 of 28
(3,327 Views)

One idea is to try drastically slowing down your data collection rate and seeing if you still get a zero every now and then.  Maybe 2s per reading kind of thing.  Just throw a timer on an error wire to make sure you are getting consistent delay between readings.

 

Use the OpenG libraries to get a timer that you can stick on an error wire.  Use the JKI VIPM to select all the openG packages and make them available in LabView.

 

Grant

Grant M. Johnson
Project Engineer
LECO Corporation
Message 23 of 28
(3,301 Views)

(So, after a long weekend...)

 

I've raised the rate to 2 seconds, but the error still occurs. Sometimes, it would give me regular readings for about a minute, then there would be 2 consecutive misreadings, so really, it's pretty random. When using a timer count on an error wire, I can tell that the delay is consistent between the readings, but when there's an error, the delay is about 2 seconds longer, which is the timeout value I've entered to the VISA serial function.

0 Kudos
Message 24 of 28
(3,267 Views)

That stinks.    I tried looking at the power supply for the first time.  It seems pretty specialized.  I'm used to working with basic supplies but these are more complicated.

 

Did you try running their software to see if it ever shows dropped readings?  I downloaded their free data logger from their Download->Software link so that might be worth a shot.

 

Every time I work with this stuff it's always hit or miss.  Try and make your delays controls on the front panel so you can control things on the fly.  See how fast you can acquire data before all you hit problems consistently and then back off from there.  I'm just shooting from the hip here.

 

Post your latest project when you get a chance.  I hope something starts working for you.

 

Grant

 

 

Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 25 of 28
(3,262 Views)

It is pretty specialised. If not for the fact that we need very high voltage and very low current (< 1mA), I probably wouldn't have chosen to work with this one. Oh well. The software doesn't have the read measurements function... Nothing else seems to work, the errors really occur at random in a number of measurements.

 

I've noticed in the communication manual that they recommend resending the command if no answer is returned in max 0,5 seconds. So this is what I was thinking of earlier: "ignore the the reading if no answer is returned and just continue as if there hasn't been any query". Any thoughts on how to do that?

 

(Like, seriously, Consort anticipates this behaviour.)

0 Kudos
Message 26 of 28
(3,247 Views)
Solution
Accepted by topic author Leukocyte

Since it sounds like every sample isn't critical you could set your VISA timeout to some value slightly above your average successful sample time and if the reading is out of range average it in with the previous x number of valid readings.  Store the value on the way through the loop in a shift register say and then check it against an expected value and if it's outside of a given range then correct it.  If the timeout for your reading is only slightly greater than your nominal sampling rate you won't incur much of a performance hit.

 

It's a crude approach but would be my first move to get something up and going.

 

Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 27 of 28
(3,237 Views)

Oh well, I've done something similar: wired the error out of the VISA read to an if case structure. If there's no error, the graph is filled, if not, the wires go through without any manipulation. Works fine for the moment, I'll consider adding a range check later. It'll work anyways. Thanks a lot!

Message 28 of 28
(3,228 Views)