Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Reentrant execution?

Hi All,

Here's my problem. I've built a photon timestamping system. I have a VI that takes a counter channel as input and uses it as a clock. The input to the counter channel is the 80MHz clock onboard the PCI 6602 card. That VI works great. Now I want to instantiate it multiple times, each instantiation will be watching a different input channel. Someone mentioned that I should setting the reentrant execution option for this time stamping subVI in order to have multiple copies running. So I've set that, but so far only my second (I only have two instantiations to start with) instantiation is collecting data. Did I misunderstand the advice I was given? Is reentrant execution for if you want to go into the SAME instantiation of a subVI multiple times? So in this case I shouldn't have reentrant execution selected? Or if I should be doing something totally different please let me know. I've included my code for you to take a look at, there's two photon simulator programs there to to use with the code. Basically what I want to do is use multiple instances of the timestamper I've built and have them all watching different counter channels.

Thanks to any help,
Chris
0 Kudos
Message 1 of 4
(3,636 Views)
My appologies, I think there's a bug in the code I posted. Here's the working code.

Thanks again for any help,
Chris
0 Kudos
Message 2 of 4
(3,632 Views)
Hi,

The problem is even a little weirder then I thought. I thought it was just the last subVI that was running. But I added one more so I had 3 subVI's going and it was only the first one that doesn't collect data properly, the other two run fine. I've included code. Any thoughts on why the 1st instance isn't working?

Thanks,
Chris
0 Kudos
Message 3 of 4
(3,630 Views)
Chris,

I don't have compatible DAQ hardware here to test it, but I think I've got it fixed. Basically, one of those many many tiny little wiring connections wasn't routed properly to the first instance of your 'Single TimeStamping' module. The value of '# to read' went into the 'buffer size' input, and all subsequent wires along the top were likewise shifted one position to the left.

This would have been hard to debug because the modules, being reentrant, wouldn't have shown the values passed in on the front panel.

Unsolicited advice: try *really* hard to avoid using those 28-connector panes! It's very difficult to wire them properly, and you can usually bundle several input values into a single cluster input to save on wire count. Personally, I stick with the 12-connector pane for general use and never use more than the 16-connector pane.

Attached is a (hopefully) fixed version of the top-level vi.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(3,622 Views)