10-20-2015 08:33 AM
Here is all of that section of code for reference. I modified one of the FGen examples; the function generate part is working fine. But I'm still struggling on how to route this marker to the switch.
Try
'Construct the FGEN object
niFGen = New InstrumentDriverInterop.Ivi.niFgen(txtResourceName.Text, True, True)
'Flag that the object has been constructed
constructed = True
'Set the output mode to frequency list
niFGen.ConfigureOutputMode(InstrumentDriverInterop.Ivi.niFgenConstants.OutputFreqList)
'Create the frequency list and obtain the handle
niFGen.CreateFreqList(niFgenConstants.WfmSquare, 1, pulseFreqArr, pulseWidthArr, frequencyListHandle)
'Configure frequency list
niFGen.ConfigureFreqList(txtChannel.Text, frequencyListHandle, Amplitude, 0, 0)
'Set trigger mode to single to output only one waveform
niFGen.ConfigureTriggerMode(txtChannel.Text, niFgenConstants.[Single])
'Enable output on the specified channel
niFGen.ConfigureOutputEnabled(txtChannel.Text, True)
'Specifies terminal to output marker on
niFGen.SetString(niFgenProperties.MarkerEventOutputTerminal, "PXI_Trig0")
'Create marker event to export, specifies bit to generate marker on
niFGen.SetInt32(niFgenProperties.DataMarkerEventDataBitNumber, 0)
'Enable output on the PXI trigger bus
niFGen.ExportSignal(niFgenConstants.DataMarkerEvent, 1, "PXI_Trig0")
'Set switch trigger input to PXI trigger bus
niSwitch.SetString(niSwitchProperties.TriggerInput, "PXI_Trig0")
'Set polarity for trigger input to switch
niSwitch.SetString(niSwitchProperties.TriggerInputPolarity, "RisingEdge")
'Start generation
niFGen.InitiateGeneration()
Catch ex As Exception
'If error occurs show it in the box on the form
MsgBox(ex.Message)
10-20-2015 09:33 AM
Marcos,
Having some trouble with the Data Marker Event Data bit set. No matter what value I specify for the data marker, I get the following error at runtime:
Unknown channel or repeated capability name. 0/0_datamarker0
I know this exception can occur if the output terminal isn't specified, but I definitely name it first:
SetString(niFgenProperties.MarkerEventOutputTermin
SetInt32(niFgenProperties.DataMarkerEventDataBitNu
Any thoughts?
Thanks!
10-20-2015 12:10 PM
Part of my issue is I'm not sure where exactly my code may be wrong. It would be helpful for troubleshooting if I could view what (if anything) is actually getting generated on the PXI trigger bus (PXI_Trig0 in my case). Is it possible to see the state of this bus anywhere?