Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

CSharp Programs for USB-1208FS, 1408FS, 1608FS

Expand / Collapse
 

CSharp Programs for USB-1208FS, 1408FS, 1608FS


Attached to this article is a zip file containing a set of CSharp examples for the USB-12/14/1608FS devices. The examples demonstrate background and foreground analog data collection, TTL trigger start and Digital Input/Output. All the examples have been created using Visual Studio 2008. One line of code determines the device; Uncomment the command line that defines the identification string DEVICE variable that is appropriate to your device.

In addition to the UL functions a few convenience functions were added such as IsError, GetBoardNum, DisplayData, CreateFileHeader and WaitForKey. The IsError function checks the error number in the ErrorInfo object and if not zero displays the error message.  The GetBoardNum function searches for a device matching the identifying string and when found exits returning the board number assigned by InstaCal. The board number is used to get the controlling device object that has AInScan function. The CreateFileHeader writes acquisition information to the beginning of the output file. The Display data writes the data to the file and console screen. And WaitForKey does just that - waits for someone to press the spacebar.

If starting a new project using Visual Studio, you must first add a reference to the MccDaq object before objects and variables. Adding the reference is usually accomplished by right clicking the Project [under the Project Explorer] and selecting Add Reference. When using the attached examples, you may need to reset the reference. To do this delete the existing reference under the Project References and then add it back in using the Add reference feature. Add the NET reference MccDaq.

Disclaimer:
The attached Code or Example is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code or Example.


Rate this Article:

Attachments



Add Your Comments


For comments email [email protected].

Details
Article ID: 50505

Last Modified:12/14/2016 10:58:10 AM

Article has been viewed 18,471 times.

Options