LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9361 X2 Encoding without a second channel

Solved!
Go to solution

Negative. I cannot even get it to work in a timed loop with a simple test vi.

elibarber_0-1762957653411.pngelibarber_1-1762957869332.png

 

0 Kudos
Message 11 of 17
(82 Views)

Can you zip your project file and share it here? Maybe save it for 2019 version for a better reach as many do not have the latest version. 

I am not familiar with your module but it sounds like something wrong with how you have it setup. Maybe the module is not setup for use in FPGA but in real time scan. 

0 Kudos
Message 12 of 17
(77 Views)

Here is the code for the target,

 

I will say everything works, including the counters for the card...

 

Even using "diagram disable" on all the stuff and trying to add in a DIO bool it fails for the NI 9361.

 

0 Kudos
Message 13 of 17
(66 Views)

Bad news, read this: NI 9361 (FPGA Interface) - NI

This module appears to be simple counter module. For measurements it uses its own time base of 10ns (100Mhz). I have not worked with something like this before, but I believe it acts like a filtered counter. It seems to be doing the counting for you based on the settings you select and give you the output. Which would take multiple STCL ticks to complete. 

Xonmyth_1-1762997288621.png

 

You should still be able to use it in while loop and handle measurement timing as below:

Xonmyth_3-1762998742703.png

 

Or

Can you use your MOD3 DIO (NI-9401)? Its DIOs are supported in SCTL.

 

 

0 Kudos
Message 14 of 17
(49 Views)

I already bought 3 NI-9361, which is what i want to use for the project because I can do 0-24V direct. The project works with Edge counting in a looped that is somewhat synced with the scan engine. (1000Hz). But even then, I noticed the timing was off-- I moved my shift registers to the Realtime program (I take the difference to get the change in edge count. since the counter returns a sum edge count). This can causes the measurement to bounce slightly high or low instead of acting stable. One easy way to smooth it out would be by doubling the resolution (rise and fall) This effectively tells me if on on a tooth or not on a tooth.

 

 

Clearly the card can increment/decrement on rising or falling edges: 

https://www.ni.com/docs/en-US/bundle/ni-9361-getting-started/page/position-measurement.html?srsltid=...

 

What baffles me is that I can't implement "Increment on rise AND fall".

 

0 Kudos
Message 15 of 17
(37 Views)

Yikes!! 

Unfortunately, since I have not worked with a counter module, my knowledge tops here for the counter module and I do not have one at my disposal to test anything. 

Hopefully, someone with experience in counter module chimes in with some suggestions. 

 

In the meantime Edit: Last resort, if this module fails to meet your needs for certain, try reaching out to your NI rep. Let them know about your situation, generally, they are kind enough to entertain exchanges. 

If they agree, maybe you can consider something like NI-9421. It is cheaper too and is supported in SCTL and also supports IO input of level of 12, 24V. Note: It is digital input only. 

0 Kudos
Message 16 of 17
(31 Views)

Adding in a regular loop.

 

This averages 9-10 on the scan engine and is set to uSec. so ~100kHz. Tested this with 1250 and 125 for the digital filter minimum pulse with on all channels. I think this might work.

elibarber_0-1763073306960.png

 

 

Message 17 of 17
(19 Views)