09-23-2014 07:15 PM - edited 09-23-2014 07:16 PM
HI forum,
i am working on a new project, where i will control multiple NI Modules (Serial AC Power Supply, AI,AO and CAN) with LabVIEW, Right now I am working on Drivers to control my instruments.
To start in the right direction I wanted to ask in the forum what is the best way of scripting in LabVIEW. I used Matlab for scripting for example running through all voltages from 100V to 230V in 1V steps, then run through all Frequencies 50-60Hz. I know there is sequence structure in LabVIEW but then i will have for example 100steps this will be confusing.
Thanks and best,
Martin
09-23-2014 07:24 PM
Scripting in LabVIEW is something else.
You seem to simply want to scan through a list of voltages and frequencies. Since you know the number of iterations at the start of the test, you would use FOR loops.
09-23-2014 07:32 PM
Hi Altenbach,
thanks a lot for your reply, yes for loops makes sens, but if i have multible tests Frequency, Voltage, current, Faults, different phases (three, one phase),... and test each each combination. Would it make sense to use Teststand to sequence this tests or make one big vi.
Thanks
Martin
09-23-2014 08:01 PM
Do you have teststand?
09-23-2014 08:02 PM
yes i could get it if needed
09-24-2014 05:15 AM
@Martin88 wrote:
Hi Altenbach,
thanks a lot for your reply, yes for loops makes sens, but if i have multible tests Frequency, Voltage, current, Faults, different phases (three, one phase),... and test each each combination. Would it make sense to use Teststand to sequence this tests or make one big vi.
Thanks
Martin
It depends on how advanced it is and your requirements.
I'd use one loop fed with all those parameters and read those parameters from a text file for easy change/expansion without needing to change any code.
/Y
09-24-2014 06:43 AM
If you are going through a sequence of tests, TestStand is often the way to go. But how much are you doing in each of those tests? If it is just take a reading and compare it to limits, then just make a quick state machine in LabVIEW. If there is a lot of instrument settings, measurement taking, etc for each test, go with TestStand.
09-24-2014 10:54 AM
Hi all,
yes there are many ways to do it a state machine would be also possible also reading the a configuration file another, but i want to have it as flexible as possible, as may more tests and instruments coming up. For right now i will have one power supply, CAN communicated relays but i would like to have current sensing and voltage sensing with a multi daq card.
So i was thinking build one vi for each of the test with variation of voltage, next current, next frequency, then for each phase, then may also fault injection test,... . Each vi could have a state machine with three states "initialization of the Instruments", "run variation test" and "summary/report". Then it would be really easy to sequence these tests with TestStand i want to avoid to have on big vi that will difficult to expand and read later.
Thanks in advance,
Martin
09-24-2014 11:01 AM
I would recommend the one state machine for all tests. You could read a text file that tells you which tests to run, put each of those states into a queue, and then dequeue your states. Do a search for Queued State Machine and you'll see what I mean. This will make it possible for people to load up any sequence of tests they may want. Adding another test is just another state to make.
09-24-2014 11:28 AM
HI crossruitz
thanks for your fast responde you mean something like this:
https://decibel.ni.com/content/docs/DOC-32822
i will look at this example and then try to implment a simple test and let you know.
Best
Martin