10-15-2015 03:51 PM - edited 10-15-2015 03:56 PM
I'm planning to get a NI-6581 adapter module for the FlexRIO FPGA card. I understand that each 8-bit data port can be configured as either input or output, however I'm wondering if it is possible to write (or read) different values to each terminals in a port (for example, writing 10101101 instead of just all 0 or all 1 to Port 0)? More specifically, for my application I'd like to have five ports (40 terminals) as output and one port (8 terminals) as input; and to control each terminal individually (data wise not direction wise). Is it doable with 6581? If yes, is there any example vi showing how to do that?
Thanks,
Bing
10-15-2015 04:40 PM - edited 10-15-2015 04:41 PM
Further explanation: I'd like to generate a 16-bit position signal with 4-bit control signal for each 20 output terminals. Each input terminal will operate separately.
10-16-2015 04:25 PM
Hello iron_curtain,
The 8-bit data ports should be able to output any bit configuration you can generate with a U8 number. If you write the number 98 to the port, the binary representation of 98, 1100010, will be output across the 8 pins of that port.
Looking through the user manual for the NI 6581 (http://www.ni.com/pdf/manuals/372629c.pdf), the FAM has 6 DIO ports (so 48 terminals) and 6 additional PFI lines. Thus, your 5 output port and 1 input port requirements seem feasible.
I would recommended looking through the example projects for the 6581 that ship with LabVIEW. If you open the example finder (Help=>Find Examples…) and search for 6581, you will find multiple examples for this FAM. Note that you will need to install the FlexRIO Driver to have access to these examples.
LabVIEW 2015 (32-bit) – English:
http://www.ni.com/download/labview-development-system-2015/5308/en/
FlexRIO 15.0:
http://www.ni.com/download/ni-flexrio-15.0/5381/en/
Regards,
j_bou
10-18-2015 09:17 PM
Dear j_bou,
Thanks very much for your advice.
After looking through the examples for 6581, I agree with you that we can split a 16-bit value to two U8 numbers and write them to two ports to drive x position; and same way for y position.
However my follow-up question is: how do we deal with input signals? To give you more details: Each input channel of our R series FPGA connects to a detector which generates ~5V TTL pulses. The pulses are independent from each other and therefore are counted per channel instead of per port. Given that, is it possible to control each channel separately (at least for READ operation)?
I noticed there is a channel-based CLIP for 6581 which is said to expose 48 general purpose I/O channels. However I couldn't find any examples with this CLIP as all available examples use the port-based CLIP. Can you please confirm whether this CLIP is a valid approach to my application? Are there any examples that I can refer to?
Thanks,
Bing
10-19-2015 02:07 PM
Hi Bing,
I think that you should be able to read just one channel without too much difficulty. To find more information about how to do this I would recommend in LabVIEW go to Help -> LabVIEW Help organize the list by Contents the select FPGA Module -> NI FlexRIO Help -> NI FlexRIO Adapter Modules -> NI FlexRIO High-Speed Digital I/O Adapter Module CLIP Reference -> NI 6581 Component-Level IP Reference. In that section there is a lot of information related to what you are trying to do and I think should be able to solve your issue.
Let us know how this works.
10-19-2015 02:43 PM - edited 10-19-2015 02:43 PM
Hi Scott,
The table for NI-6581 Channel CLIP I/O is very helpful. Although there are no example with this CLIP but I think I can modify the existing ones from port-based to channel based.
Can I ask you one more question: if I want to customize CLIP items for NI-6581. Is there any reference on how to do it?
Thanks,
Bing
10-20-2015 06:22 PM
Bing,
Unfortunately there are not a lof of references that we have for customizing CLIP items for FAMs. The best thing that I could find to get you started was this link.
10-20-2015 06:44 PM
Hi diabeticdaniel,
Thanks for the link. It's very helpful!