I'm trying to control a bunch of relays connected to a NI 6008 and 6501 unit. I've got a program which can take a binary coded decimal code and turn on the appropriate relays for that code but I'd like to automate the system to free me from keeping an eye on the clock and changing the code as necesary. As such I was trying to get the program to reference a spreadsheet each iteration of the loop, however this returns an Array which I can't seem to find a block which will pull the value I require out. I then tried making a waveform replicating the on/off cycle of the relays with no joy at pulling the value of the waveform at each time step out and giving them to the microcontrollers.
I'm sure there must be a simple way that the program references an array/speadsheet/waveform and gets the value out at the specific time but I can't seem to find it!!
The number is a double, 64bit real type.
Sample data would be the number being 0 for the first 40seconds, ramp up to 7 in the next 10 seconds, hold that for 20 seconds then ramp back down to 0 in a final 10 seconds.
Any clues or suggestions would be very much appriciated!!
Solved! Go to Solution.
Thanks for that but it's not the generating that I'm having a problem with, it's more the getting LabVIEW to recognise that I want to output the prescribed waveform in real time, i.e. at 20 seconds into running it will reference the waveform at 20seconds, see the value on the graph at that point (lets say 3) and give this value into the DAX assist which will switch on three lines.
I've got the switching bit covered as the number of resistors will be in binary coded decimal but it's the middle bit I'm after.
This snippet shows how to use the time delay express vi to get the type of operation I think you are looking for.
You say you have the DAQ code working so I left it out of my example. You may also want to OR the Stop from the file with a boolean on the FP so you have control of the ecexution without relying on just the file. Although you specifically stated you wanted to read the file for each "vector" its going to be much more effecient to read the whole file at once and auto-index the2D array. However you could read a line at a time if your file is changing durring execution
That's brilliant cheers Jeff.
I had to split the array twice and wired it up to the iteration count to make sure it kept looking at the next line but that's solved a lot of problems!!
I've attached a picture of my final program incase anyone else has the same problem.
Glad to help!
I would recomend forcing some data depandancy by wiring error in and error out from your sub-vis but it looks like you got a good solution for your needs!