LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean 0,1 to 1,0

Probably really easy - is there a simple way to change a Boolean 0,1 to 1,0? 

 

 

I have an on/off signal that is off when the signal is high and on when the signal os low, but I can only see 0,1.  Been trawling through the docs and this forum for 2 hours but no joy.  I have a counter that will count single units when the signal is high - ie. adds '0' to the shift registers as they loop, or adds '1' when the signal is low so in effect counting in two's, which is what I want.  It does work now but in reverse. 

0 Kudos
Message 1 of 11
(6,237 Views)

Hi Matt_H,

what do you mean? Do you need the "Boolean to (0,1)" function or the invert?

 

Mike

0 Kudos
Message 2 of 11
(6,236 Views)
Just need to invert it.  So instead of 0,1 I get 1,0.  So 1 when it's low instead of 0, and 0 when it's high instead of 1.
0 Kudos
Message 3 of 11
(6,234 Views)

Hi Matt_H,

in this case you can use the invert function, it's on the boolean palette. If you value is a numeric value, then you can use the "equal to 0" function combined with a select.

 

Mike

Message 4 of 11
(6,232 Views)

I have a stepper motor driver (G203V) where I have three input; DISABLE, DIRECTION, STEP that work on 0/1 logic.

 

The DISABLE input on the G203V is optically isolated and requires logic “0” to DISABLE. Once it is disabled, the motor windings go open
and the motor freewheels.

 

The G203V steps the motor on the 0 to 1 logic (positive) edge of the STEP signal.

 

The DIRECTION input work the same way ClockWise and CounterClockWise on 0/1

 

 

My question is this.

 

I want a boolean switch to control the DISABLE and DIRECTION inputs.  FALSE = 0 and TRUE = 1

 

This being said I know there is a "Boolean To" option that converts to 0,1 however how to I output this as a digital output to my DAQ and therefore to my driver???

 

What would be the proper way to do this?

 

 

Thanks much everyone,

Jerry

0 Kudos
Message 5 of 11
(6,046 Views)
You would be just overly complicating things if you convert the Boolean to 0 or 1. Just wire the Boolean directly to the DAQmx Write set for Digital Boolean 1Line 1Point. You can of course complicate things and convert to a 0 or 1 and use an of the integer DAQmx Write formats.
0 Kudos
Message 6 of 11
(6,037 Views)

1. Okay so can you take a look at this and see if it makes sense.

 

I am outputing a digitial signal for the DIRECTION, DISABLE and STEP.

 

I want to be able to output 0/1 logic for DISABLE and DIRECTION

 

I also want to output a frquency and duty cycle which I have set up. 

 

 

2. Also, how to do I get this to start on me pressing START not when I initially run the program?

 

Thanks,
Jerry

0 Kudos
Message 7 of 11
(6,025 Views)
You've got the logic correct for the disable and direction so you just need to place all of the code inside the case statement wired to the Start button.
0 Kudos
Message 8 of 11
(6,019 Views)

What would be the difference if I had the "task" inside the case structure and not outside the while loop?  Do I want to leave this outside the while loop?

 

Thanks

0 Kudos
Message 9 of 11
(6,016 Views)
If you had an explicit start and stop task outside the loop, you would probably save some msecs in each iteration. Not sure of exactly how many. Maybe as many as a couple hundred.
0 Kudos
Message 10 of 11
(6,011 Views)