Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use niFgen ExportSignal() function for routing PXI_Trig5 line to PFI1 terminal

We have NI 5402 board. The name of the board in NI MAX is "GEN1"

 

According to the NI MAX it should be possible to connect PXI_Trig5 line to PFI1 terminal - we would like to monitor signal at PXI_Trig5 with oscilloscope,

There is a direct route between "/GEN1/PXI_Trig5" and "/GEN1/PFI1" - see attached picture.

 

How we can set such connection?

 

NI 5402 board is a signal generator, covered by niFgen driver. The function for routing signals is niFgen_ExportSignal, which according to the help, has the following arguments (we are using .NET 😞

 

niFgen ExportSignal ( ViInt32 signal, ViConstString signalIdentifier, ViConstString outputTerminal);

 

What values of the arguments we should use?

    ExportSignal ( 0, "/GEN1/PXI_Trig5" , "/GEN1/PFI1"); - does not work!

 

May be we should use DAQmx function    ConnectTerminals("/GEN1/PXI_Trig5" , "/GEN1/PFI1") instead?

 

 
     
     
     
0 Kudos
Message 1 of 6
(4,930 Views)

Hey gremlm,

 

I see that you're trying to route a signal from PFI1 to PXI_Trig5. You're correct saying the 5402 board uses the NI-FGEN driver, so I don't think that using a DAQmx function is going to be much help here.

 

Actually, in NI-FGEN, the PXI trigger lines are also referred to as RTSI<0..6>. So basically saying PXI_Trig5 is the same as saying RTSI5; The relationship is going to be one to one. I would try using /GEN1/RTSI5 instead of /GEN1/PXI_Trig5 and see if that helps.

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(4,922 Views)

It does not work. Always the same error appeares: "Invalid value for signal name".

I have tried both cases

 

        niFGen.ExportSignal(0, "/GEN1/PXI_Trig5", "/GEN1/PFI1");

and

        niFGen.ExportSignal(0, "/GEN1/RTSI5", "/GEN1/PFI1");

 

What signal name should be used here?

May be error is realted to the first argument of the function, the integer value, not the second one?

 

0 Kudos
Message 3 of 6
(4,915 Views)

I have tried different way to use both functions, niFGen.RouteSignalOut(....) and  niFGen.ExportSignal(...)  for connecting PXI triggers to PFI1 terminal.

All of them failed! The onl what worked is to connect SampleClock to PFI1 (selected in bold):


                    try { niFGen.ExportSignal(0,"/GEN1/PXI_Trig3", "/GEN1/PFI1); } catch { }

                    try { niFGen.ExportSignal(niFgenConstants.Rtsi4, "","/GEN1/PFI1"); }  catch { }

                    try { niFGen.ExportSignal(niFgenConstants.SampleClock, "", "/GEN1/PFI1"); } catch { }

                    try { niFGen.RouteSignalOut("" , niFgenConstants.Rtsi4, niFgenConstants.Pfi1); } catch { }

                    try { niFGen.RouteSignalOut("0", niFgenConstants.Rtsi4, niFgenConstants.Pfi1); } catch { }

                    try { niFGen.RouteSignalOut(null, niFgenConstants.Rtsi4, niFgenConstants.Pfi1); }  catch { }

                    try { niFGen.RouteSignalOut(null, niFgenConstants.Rtsi4, niFgenConstants.Pfi1); }     catch { }

                    try { niFGen.RouteSignalOut("0", niFgenConstants.Ttl4, niFgenConstants.Pfi1); }    catch { }

 

The attached file provides the view of the NI Trace

According to NI MAX, the connection what we need, from PXI trigger, (like PXI_Trig5), to selected PFI line could be done. HOW?

0 Kudos
Message 4 of 6
(4,902 Views)

Hey gremlm,

 

This test is rather interesting. The help for the ExportSignal command  has various defined values for certain parameters. In your test, the sampleClock worked, but the Sample Clock is a defined value for the signal. Check that link out to see some of the other defined values for the various parameters. You can also find this in the HTML help file under the NI-FGEN driver.

 

Talking to some other engineers here, I think you would have to look at using Daqmx Connect/Disconnect for connecting these terminals. 

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 6
(4,898 Views)

Amasingly, DAQmx -based ConnectTerminals works for FGEN!

We can see the pulse generated from the digitizer counter routed though the PXI_Trig5 at PFI1 terminal of signal generator.

The only issue is that default state of the PXI trigger line is HIGH, not low. Any idea why is that?




Sincerely,
   Grigoriy Milman

0 Kudos
Message 6 of 6
(4,887 Views)