02-25-2009 12:29 PM
Hello,
I'm trying to interface with a controller that reads in a 4 bit signal through 4 channels of a PXI board. I'm generating the 4 bit signal with a cFP-DIO-550. The problem arises from the fact that the PXI board is reading its 4 bits in parallel and responding to a change in the state of any one bit by performing the action associated with that 4 bit number, but my DIO board is writing each channel sequentially. Eg: I want to send the binary number 1110 to the controller. The DIO-550 output as seen by the PXI board looks like this "1000...1100...1110" over some time step. This results in the controller going first to the "1000" state, then the "1100" state, and finally the "1110" state that I wanted.
Is there a way to simultaneously turn on multiple channels of the DIO-550?
02-25-2009 02:28 PM - edited 02-25-2009 02:30 PM
I just tried creating an item in MAX that containted the four output lines that I want to write to, but wiring that to the FP write VI did absolutely nothing. I tried writing an array of four boolean values, then a single boolean, but neither attempt successfully turned on any of the channels.
I found this post, which sounds like a similar problem to what I'm having. Tried the method that worked for Keney, but it did not work for me.
02-27-2009 10:26 AM
Try this:
Instead of treating the the outputs as discrete booleans, you can write to all of your output channels as an integer.
(Actually, to be more precise, the FP Write (polymorphic) VI accepts a DBL).
You're on the right track with creating a FieldPoint item for just the four outputs you need. Now, use the FP Write to send the number representing the bits you want turned on. In your example, assuming the 4 bits are channels 3210, and you want 1110, send the value 14 to your item.
If the outputs you want to control are different, you'll have to determine the value for each bit.
(e.g. if the outputs are channels 7654, the output in binary is 1110 0000, or decimal 224.
Good luck!
03-02-2009 10:01 AM
Thanks for the reply, Eagle.
I noticed in MAX that the channel data type is "2-byte uint" which I assume is the U8 constant data type. Tried wiring that in to the output and got no response from the module. Did I use the correct data type?
03-03-2009 05:05 PM