09-03-2010 07:28 AM
Hi
I am trying to "Get STarted" with the PXI 5102 and PXI 6040E. I am trying to compile some of the examples for Visual Studio 2008 (.Net 3.5) that installed when I installed NI-SCOPE library for the .NET.
This is the code from the "Getting Started" example
sampleScopeSession.ResourceDescriptor = resourceNameComboBox.Text;
sampleScopeSession.Channels[channelNameTextBox.Text].Enabled =True
sampleScopeSession.Open();
sampleScopeSession.AutoSetup();
sampleScopeSession.Channels[channelNameTextBox.Text].Enabled =True
scopeSingleRecordReader.ReadFromSingleChannelAsync(channelNameTextBox.Text, 0, sampleScopeSession.Timing.ActualRecordLength,
true;true;ScopeChannelCoupling.AC;PrecisionTimeSpan.FromMilliseconds(1000), null);
This is the error:
Warning 3FFA4004.
Possible Reasons:
Auto Setup was unable to find a signal.Error BFFA000C.
Possible Reasons:
Attribute ID not recognized.
Please help me see what I am doing wrong.
Thank you.
Alberto J.
09-07-2010 06:36 PM
Howdy Albert!
What version of NI-Scope are you using?
Also, had you made ANY modifications to the example program before you tried compiling it?
Regards,
09-09-2010 11:08 AM
It was buried in the .NET Class libraries readme file (and I couldn't find it anywhere else), but Traditional DAQ devices (including the 5102) are not supported. We don't explicitly ensure that Traditional DAQ devices won't work but we don't support them either. I will say this is not well documented and could be made more obvious to anyone trying to use the .NET examples.
I did track it down so far as to discover the attribute in question and I believe the call is coming from somewhere in the Read performed after autosetup.
I did find another forum post from someone with a similar issue and a KB regarding a workaround:
http://forums.ni.com/t5/Measurement-Studio-for-NET/NI-SCOPE-NET-Class-Libraries-1-1-1-Now-Available/...
http://digital.ni.com/public.nsf/allkb/52D289F65941474A86256E8A0057D72E?OpenDocument
I am not familiar enough with .NET to get this workaround working before I posted this. I will see if I can figure out how to modify the example code but maybe you can get it to work for you in the meantime.
09-14-2010 03:02 PM
HI, finally I got some of the samples to work with the NI-5102.
Now my job is to creta a program like the "Scope soft From Panel" and add functionality to it.
I am using "Scope Soft Front Panel" version3.0rc2. This software works well with the NI-5102. If the NI-SCOPE libraries do not support the PXI-5102, I wonder what are they using in the "Scope Soft Front Panel" to control the NI-5102. Yes, I know it is built using labview, but there has to be a way to find out the functions being called. I used NI-SPY and I can see the functions being called, but they are too many to analyze.
So far I have the main interface built. I can use the AutoSetup function, but this functions works sometimes only. I could work around this. What I can not do is pause the acquisition of data and restart it again. I am using oscope.Abort(); oscope.Close(); to stop it and then I use oscope.Open();
SetChannels();
SetTriggeringInfo();
SetTimingInfo();
oscope.Acquisition.Initiate();
myScopeSingleRecordReader.MemoryOptimizedFetchFromMultipleChannelsAsync(channels_in_use, 0, -1,PrecisionTimeSpan.FromSeconds(Double.Parse("2")),waveformCollection,null);
but the application will not start to acquiere the data and no exception is thrown.
THANKS FOR ANY HELP.
09-15-2010 04:00 PM
Dear Albert,
We need to make sure that you are actually releasing the reference to your scope when you use oscope.Abort(); oscope.Close(). Comment out the lines where you reinitialize your scope and run this program. Then try to see if you can do some acquisition with your hardware using the Soft Front Panel after doing this. If you closed the reference to the scope successfully, then you should not get any error. However if you did not close the reference, you will get a conflict of resources error.
Take a similar approach by initializing the scope for a second time and comment out all the lines after it. See if you get an error when using the Scope Soft Panel.