08-16-2012 01:19 AM
Hi,
I am developing an application in c# .net for downloading some data in to the FF device. I am using the DownloadDomain() method for downloading the data. The .net libraries support the DownloadDomain() method in VFD class and cannot be used in MIB class. As per specifications, MIB also should be a VFD but .net libraries are not recognizing MIB as a seperate VFD, instead it is considering MIB as a separate class. Please help me on this.
Regards,
Sundar
08-16-2012 02:40 AM
Hi Sundar,
Could you please try the following?
curVFD = curDevice.GetVfdByOrdinalNumber(0); // to open the default VFD to get the block information
curVFD = curDevice.GetVfdByTag("MIB");// to open the MIB VFD.
Thanks.
Chris
08-16-2012 02:57 AM
Hi Chris, The first method GetVfdByOrdinalNumber(0) works with 0 as the ordinal and returns the default VFD but the second method GetVfdByTag("MIB") returns an exception stating the VFD could not be found. Regards, Sundar
08-17-2012 02:10 AM
Hi Sundar,
Oh yes, I have done some tests with the C#.net example. You are right, we did give a Mib class for this usage. Would you please refer to the source code piece to get what you want?
**********-----------------------*******************
// ...
Device curDevice;
curDevice.Open();// open device.
curDevice.Mib.Open();// open the Mib
Parameter curParam = curDevice.Mib.ReadParameterByName("T1");// read parameter "T1"
SimpleVarParameter svp = curParam as SimpleVarParameter;// since T1 is a Simple Var Parameter.
// More Parameter Type please refer to readData_Click(object sender, System.EventArgs e) in ReadWrite.cs
MessageStatus.Text += (" " + svp.Element.ValueString());// output the value string to MessageStatus
// ...
**********-----------------------*******************
Please give a try and let me know if it works.
Thanks.
Chris
08-17-2012 03:10 AM - edited 08-17-2012 03:10 AM
More details, you could also refer to the help file for .Net Library:
C:\Program Files\National Instruments\NI-FBUS\MS .NET\doc\NIFBusCM.HxS
08-17-2012 03:50 AM
Hi Chris,
Thanks for the reply.
I am able to read the parameters from the MIB class but my requirement is to download data into the device. For this, i need to use the DownloadDomain() method. This method is in the VFD class. I am not able to access this method from MIB class. For my operation, i need to download data in MIB vfd.
Is there any way i can call the downloaddomain() method from the MIB.
Regards,
Sundar
08-19-2012 09:22 PM
Hi Sundar,
It might sound weird, but could you please help do a test?
1. Get the Domain Index parameters from class Mib
2. Download Domain using VFD(0) reference.
And let me know if it works this way.
Thanks.
Chris
08-20-2012 12:40 AM
Hi Chris,
We tried this option but unfortunately could not succeed. we are getting an exception when we tried to download to the index which we received in the MIB class.
Regards,
Sundar
08-20-2012 12:57 AM
1. Could you please let me know the exception message?
2. Did you do the same DomainDownload() using C language? and successfully?
Regards,
Chris
08-20-2012 04:18 AM
Hi,
1. I am seeing "FBInvalidDescriptorException" when i try to use the downloaddomain.
2. I tried using the DownloadDomain() API in C. Its working good.
Regards,
Sundar