From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency of read/write FPGA control calls

Solved!
Go to solution

Hi,

 

I use a cRIO-9076 with a NI-9476 DO module to switch some valves. Sometimes it is necessary to pulse the valves with a pulse time down to a few ms.

 

The FPGA VI gets the valve on/off requests, runs some safety logic, and routes the results to the digital outputs. It gets the on/off requests from the VI on the RT target which uses the "Read/write FPGA control" function for programmatic front panel interaction of the FPGA VI. The loop on the RT runs with 1 kHz, no iterations are missed. It means, it should be possible to switch the valves with a resolution of 1 ms.

 

What I observe on a scope is that the digital outputs are high for multiples of 50 ms, the system fails to pulse the valve for e.g. 80 ms, or pulses shorter than 50 ms. Is there some sort of limitation for calls of "Read/write FPGA control"? I tried both arbitration options but it doesn't help.

 

Any ideas or better knowledge of the limitation of the cRIO/module/functions? Thank you in advance.

 

Karsten

0 Kudos
Message 1 of 5
(2,446 Views)
Solution
Accepted by topic author karsten281

Hi Karsten

 

Are you using any timing in your FPGA VI?  

 

It is worth sending your code through as an attachment so that I can have a look at it.  

 

Kind Regards

Marshall B
Applications Engineer
National Instruments UK & Ireland
Message 2 of 5
(2,436 Views)

Marshall B,

 

Thanks a lot, mentioning timing in the FPGA VI was a very useful hint. Since I've always considered FPGA VIs as very fast, I couldn't imagine that this part would be the source of the odd behavior.

 

I don't use timing in the FPGA VI. To test how fast the FPGA VI runs I tried to negate a boolean in each iteration of the FPGA loop and to route it to one of the spare digital outputs. And, surprise, I got a nice square wave with a period of 102 ms (51 ms high, 51 ms low). Then I had a deeper look into the FPGA part and found that I read an analog input (high resolution mode) from a NI-9207 module in the same loop. A deeper look into the manual: Conversion time 52 ms 🙂

I wasn't aware of that the loop always waits for a new sample. I thought it would just use the most recent one.

 

So, thanks again. I guess moving the read function of the AI into another loop will solve my problem.

 

Karsten

0 Kudos
Message 3 of 5
(2,423 Views)

Hi Karsten

 

It sounds like you are close to solving your issue.  

 

Let me know how that works out for you or if you need any more help.

 

Kind Regards

Marshall B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 5
(2,421 Views)

Hi again,

 

The issue is solved. It works fine with two loops separating analog I/O from digital I/O. Thank you for putting me on the right track.

 

Best regards,

Karsten

0 Kudos
Message 5 of 5
(2,415 Views)