LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 461 PFI Input trigger to generate software event

My system has a PCI4661 DAQ and an PCI1588 sync'd to PTP. I have CVI 2015 anD NI Sync 16. I also have other network devices set to PTP.

My appliation requires all devices 4461 AO/AI and network devices to trigger and I am sucessfully using the 1588 to trigger my 4461 future timed event. The trigger is generated over RTSI.

I also need to respond to an external trigger edge and I am trying to connect an application callback to one of the PFI terminals (either 4461 or 1588). From the callback I can get the timestamp of the edge and then create a future event to start all devices triggering.

I have done quite a bit of reading around can not find a way to use a PFI to generate a software event. I understand that PFI does not provide fulls buffered operation but I simply need one way or another to get a software event.

Does anybody have any ideas to how to get an event ?

Thank you in advance, the support from this forum is invaluable.

Steve

0 Kudos
Message 1 of 5
(3,053 Views)

Update: The 1588 user manual has a section on "Using Front Panel PFI Lines as Inputs"

This hints that what I am trying to do is possible and refers to the Ni Sync User Manual for more information, but this is where the trail stops.

 

 

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

Hi,


Hopefully, this knowledge based article will help.
http://zone.ni.com/reference/en-XX/help/373629B-01/nisynclv/nisync_create_future_time_event/

 

Regards,
Alex

0 Kudos
Message 3 of 5
(3,018 Views)

Hi Alex.


Thanks for the reply (I was out all christmas). I have had a look at the kb article and this describes the future time event to generate an output (or am I missing something?). I am looking to use a PFI as an input to call a software callback. Are you saying that the PFI signals can only be used as outputs?

 

Steve

0 Kudos
Message 4 of 5
(2,970 Views)

Further update:

 

I have found that I can use a timestamp to wait for a edge event to occur on a PFI input. The niSync_ReadTimeStampTrigger has got a timeout. My code now spawns off a task that runs the following code

 

void NiSyncExternalTrigger(char* terminal, int32_t timeout)

{

    NiSyncTime_t triggerTime;

    int32_t status;   

    NiSyncTimeInit(&triggerTime); 

    status = niSync_EnableTimeStampTrigger(session665x, terminal, NISYNC_VAL_UPDATE_EDGE_RISING);

    CheckError(status);

status = niSync_ReadTriggerTimeStamp(session665x, terminal, timeout, &triggerTime.Seconds, &triggerTime.NanoSeconds, &triggerTime.FractionalNanoSeconds, &edge);

}

 This can then send an event back into my event processing and send my trigger to all other systems.

 The key was finding that the nisync_ReadTriggerTimeStamp had a timeout and would wait until either an edge was detected on the PFI, or the timeout expired.

I need to do some further investigation to see if I can route PFI to the RTSI bus and still get the timestamp event.

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