01-12-2015 07:45 AM - edited 01-12-2015 07:49 AM
I have a problem that I can't seem to solve. I have a array of 6 valves that are a type def. I want to be able to indicate which ones are on using a for loop. The for loop count terminal is wired to the number of valves that are being tested. I expected indicators 1-5 to turn on in the example, but only 5 shows on. Can you tell me what I am doing wrong?
I just figured it out, sorry to bother you. I changed the input tunnel to a shift register and left the output tunnel as last value still connected to the valve indicator.
Thanks.
Solved! Go to Solution.
01-12-2015 08:18 AM
You need to use a shift register. Without it, your iteration 1-4 does nothing and the data is disregarded.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-12-2015 08:21 AM
Also is there a reason you want to wait 500ms between each replace? And did you know you can do this without a for loop? Attached is an example.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-12-2015 08:50 AM
The delay was inserted just so I could see what was happening a little slower (was originally 1000ms) with highlight execution.
I don't think your diagram without the for loop will work - the original valves all start with the indicator status off. This is part of a state machine that tests up to six valves. The count terminal of the for loop is used to iterate the loop the number of times depending on the number of valves being tested.
Thanks for the feedback, Hooovahh.
01-12-2015 09:10 AM - edited 01-12-2015 09:11 AM
metzler wrote: I don't think your diagram without the for loop will work - the original valves all start with the indicator status off. This is part of a state machine that tests up to six valves. The count terminal of the for loop is used to iterate the loop the number of times depending on the number of valves being tested.
Then use Initialize Array.
01-12-2015 12:11 PM
@metzler wrote:
I don't think your diagram without the for loop will work - the original valves all start with the indicator status off.
Oh right, either initalize as mentioned, or what I should have done is set the control to 6 falses then right click Data Operation >> Make Current Values Default, and saved the VI.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord