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

Try running your VI with Highlight Execution (the lightbulb in the block diagram toolbar) turned on.   You will see that the Parameters cluster is read immediately when the while loop starts executing. The Event structure does not execute until the Parameters value changes. HOWEVER, when the event structure excutes it passes the values on the input tunnels to the subVIs and those values were the ones read at the beginning of the iteration.

 

The Parameters cluster terminal needs to be inside the event structure.

 

Lynn

Message 11 of 28
(4,379 Views)

Thanks! Actually I tried the Highlight Execution, but I still didn't understand why the wrong value was sent... silly me.

New question, here comes the real purpose for this power supply: it's supposed to run in manual mode with the user able to change the parameters in real time. But it's also supposed to run step sequences (like for example: run ->2 minutes at 100 V -> 3 minutes at 150 V -> stop). Ideally, the user should be able to adjust the parameters while the sequence is running (in case there are slight variations to compensate for example). The question is, how to do this?

 

I've programmed a sequence both by using a sequence of case structures wired by error clusters and by using a state machine, where each state corresponds to a step in the sequence. Which one would be more recommended? Which one would give the user control for real-time adaptation? Which one would allow for an easier addition of subsequent steps? (I'm guessing for the case structures, I'd have to apply a set amount of steps and let the user choose, how many of those to use. But could a state machine in some way enable the user to add as many steps as required?)

 

I'm not really asking for a specific way to this, just wondering what way you'd recommend. If there's another possibilty I didn't even think of, I'd be glad to look into it. The codes are just drafts to give you an idea of what I mean using example controls.

Download All
Message 12 of 28
(4,357 Views)

 

 

I tried to use the JKI state machine to simulate what you explained.  It took me longer than it should have because I had to use Functional Global Varibles for the first time and that bothered me.  I feel I had a good reason for using them and it will be interesting to see what the community decides.

 

I wanted to have the strip chart be basically freerunning and have the sequences be modfiers rather than drivers.  That is they shape the functionality and not create it on their own kind of thing.  I also wanted a fairly simple way of adding sequences and I wanted some kind of recovery from errors even though the error handling here is simple at best.

 

I put this together based on your first thread and started around 11:15AM.  Now that is is 6:00PM and I'm finally finished with the roughest of drafts I don't have the feeling that I actually answered your question.  On the off chance that this code will serve some purpose however I'm attaching it here.

 

Grant

 

Grant M. Johnson
Project Engineer
LECO Corporation
Message 13 of 28
(4,306 Views)

Sorry for the double post.  

 

I'm at home now and running the project from a machine that doesn't have the jki state machine installed.   My project is looking for jki.vi's and I don't even have their package manager installed.  

 

To install it I went to :

 

http://jki.net/vipm/download

 

I ran the installer and took all the defaults.  After the install the JKI VI Package Manager program started right up. It started downloading stuff and took awhile to finish.

 

Once it was finished I scrolled down and then highlighted all of the jki files.  Maybe about 15 of them.  I then hit the icon in the upper left to start installing the packages.  I was asked a couple of questions and I answered yes to all of them.  

 

It's taking several mintues to install.  It might be close to 30 minutes by the time it's done.  I remember I only needed to do this once and the JKI state machine alone is worth the wait.

 

When it was finished the installer showed the summary attached as finished.png.

 

After all of this was complete LabView started up again and my example from my previous post ran as expected.  

 

I noticed you mentioned running a sequence and then stopping.  I'm running the sequence, checking for all of the sequences to have been run (current array index == sequence array size) and starts over at the first sequence again.  You could simply exit at this point.

 

Give the JKI state machine a try.  It really is a great tool.

 

Grant

 

 

 

 

 

 

 

 

 

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

Please delete ... I couldn't figure out how to remove once I had submitted another post.

 

 

Grant M. Johnson
Project Engineer
LECO Corporation
Message 15 of 28
(4,300 Views)

Here is an updated version.  I was running the state every time through the loop so when the user would make a change the state would update it and the users change would be overridden.  I'm now checking for a state change and when one occurrs calling the state just once.  I think this is more inline with what you were looking for.  The sequence is running along and the user gets to make changes that override the sequence value.

 

 

Grant M. Johnson
Project Engineer
LECO Corporation
Message 16 of 28
(4,292 Views)

I'm running the installer right now (the direct link didn't work for me, for those who are interested, simply go to http://jki.net and select Products > Download VIPM).

What I actually wanted to say was:  you didn't just spend 7+ hours on my problem? That's just... wow. Thanks man!  I'll just try your last version, since you said it's updated. I'm really looking forward to how it works out.

Message 17 of 28
(4,272 Views)

Could you save it as an older version ob Labview please? I'm using the 2013 version at work...

Message 18 of 28
(4,263 Views)

I was able to load this project in LV2013.  Hopefully I packaged it right.  Once you can build it let me know and we'll talk about the particulars.

 

Don't be too impressed with how long it took me to do this.  This is actually my first LabView post.  I'm still climbing the steep part of the learning curve myself.  Well, every part seems like the steep part when you climbing right?

 

Grant M. Johnson
Project Engineer
LECO Corporation
Message 19 of 28
(4,251 Views)

Thanks a lot! Woah, that's some heavy stuff. With my (exactly) 10 days of experience in Labview programming, I really can't get my head around it. But, since my internship is going to last a few months longer, I'll be sure to come back to it as I progress. Just from looking at how it works, it seems to be doing pretty much exaclty what I wanted it to do. So yeah, great job, thank you!

0 Kudos
Message 20 of 28
(4,229 Views)