03-25-2012 01:38 AM
Hi,
I am trying to generat 3 bit digital signal using 9403 digital module and cRIO 9014.I have to generate all the combinations from 000 to 111.So i have to give boolean constant either true or false to output module 9403.I am not gettimg how to incrase step value from 000 to 001 and so on..Should i use shift register??
I know how to use shift register for integer value bt i dont hv any idae about boolean value.
hoping for solution....
Solved! Go to Solution.
03-25-2012 07:27 AM - edited 03-25-2012 07:28 AM
Try this simple example.
03-25-2012 12:47 PM
Thank u.
But is it neccessary to use DAQmx ?? Is it possiple without DAQmx??becoz i hv to use digital output module in FPGA VI...
And have to use generated signal in HOST VI...
03-25-2012 01:42 PM - edited 03-25-2012 01:43 PM
Yes you can do this with FPGA. You might not need to use a shift register at all.
EDIT - You can use shift registers to store any data type if needs be
- Do you want the values to change at a given period or from a user input?
- After you ramp 0-7; do you want to stop generating, continue or set a safe state (0,0,0)?
Dennis' example is taking advantage of the fact that a number is binary. So in the U8 - 0 is 000, 1 is 001 and so on. As you only have 8 variables you could initialise a boolean array of all of the combinations, or you could convert the numeric to its binary equivalent to write to the 3 FPGA outputs.
For cRIO applications the CompactRIO Developers Guide shows how to communicate between Host - RT - FPGA. You should get some more ideas from there
03-25-2012 01:51 PM - edited 03-25-2012 01:51 PM
Here is a little example which uses the Number to Boolean Array function. The Numeric indicator has it's display formatting set to binary (%b).