LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wrong type of boolean

Hello

I am for my schoolproject trying to control a carmirror from labview using a DAQ USB-6008 card. For controlling the mirror to turn left or right I will use a H-bridge, and with the USB-6008 I will generate signals for the H-bridge. 

I was going to use this: (firts picture: screenshot 2)

But then my teacher said: u need to be sure that you can't send a signal for turning left and turning right at the same time!

I had then the idea to use a case structure: (picture 2: 1.PNG) (i found this on the internet)

But when I wanted to change the LED's to control the DAQ assist i found out this is the wrong datatype. (picture 3: screenshot 1)

Is there anyone who knows what I can do?

thank you!

Download All
0 Kudos
Message 1 of 3
(1,933 Views)

The error text is quite clear: the DAQ Assistant is expecting an array of Booleans.  You obviously have the DAQ Assistant set up to either output many signals or a stream is signals.  So take your "data 8" and "data 9" from your first image and have them be selected from by the case structure.  To make things more obvious, you could just use the Select function instead of the case structure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(1,910 Views)

In addition to what Tim said, you should probably take a step back and look at image "2019-02-10 (2).png" and maybe talk to your teacher. It makes no sense to run both motors in parallel and the outer loop can only go the the next iteration once both motors have stopped. While loops inside while loops is a really bad idea! You are painting yourself into a corner.

 

You only have exactly one motor and the direction is fully determined by the state of four switches. In your case, all that changes is the value of a boolean array with four elements. You only need exactly one express VI and all you program needs to do is send one of three boolean arrays (left, right, off), depending on the desired state. This last sentence should give you a hint: State machine!

 

Now for the front panel, you need two scalar switches that should be "switch until released", one labeled "Left" and the other "Right". This mechanical action ensures that the switch is only ON while you are pressing down with the mouse and it is impossible to press both at the same time. To press the other, you need to naturally release the first.

 

Overall, what you need is a state machine that translates the states of the two buttons into one of a selection of boolean arrays with four elements each. You only need one outer while loop that runs at a relatively slow rate and one motor IO express VI that gets called once whenever the boolean input differs from the current value. Even better would be an event structure so the loop only spins when needed.

 

 

0 Kudos
Message 3 of 3
(1,895 Views)