11-24-2014 02:26 AM
Hello,
I would like the the binary number in the "resulting string" to control the case structure in a sequence. So, the number 9 should give "true", "false", "false", "true", to the case structure in a timed sequence. I cant seem to connect the boolean array to the case structure without getting errors.
Any help would be appreciated!
11-24-2014 02:29 AM
No, you cant connect an array to a case structure. What you should to is to use "boolean array to a number" and use the resulting number in the case selector. As such, it'd be the '9' case.
/Y
11-24-2014 02:31 AM
A case structure takes scalars, not arrays.
Move the number to boolen array to the outer loop and auto-index the boolean array on the inner loop boundary.
11-24-2014 03:34 AM
Hey there.
Yes, that is almost working. A new problem has emerged, the sequence that is transferred to the case structure does not match the output string. I doesn't send 1001.
11-24-2014 10:31 AM
I don't see any strings as you describe. can you clarify what you mean?
Why is there so much duplicate code?
11-28-2014 03:49 AM
Hi Rydman,
Do you care to explain what you want your program to do? Because as I see it you want to generate two different output arrays in a predetermined way. Then this would be my suggestion.
Put the Create channel and timing and SampClk.Rate outside of the while loop, as long as you dont want this to change between the generations. But still having it like now you will not really know where the code is when you change the values of front panel controls.
Within the loop I would use the Write, start, task done and stop task. I would stop the loop on an error and have your selection of cases just control the generation part.
The clear task and simple error handler I would have outside the loop to show errors and clear task when you stop the program.
As you have an array of output waveforms can't you just fill this array up with many waveforms?