Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting coding to (I/O card) signal

Status
Not open for further replies.

jl3574

Programmer
Jun 5, 2003
76
0
0
CA
I am developing a control application which thru a series of calculation the output is a number (int) this number will communicate with a industrial robot (ABB). The number will be a voltage number which will tell the robot to change the power higher or lower. The programming end is done. However my question is I have an I/O card what is the process of converting this integer value ( i written this application is c#) into a voltage signal I have no idea where to start looking for info on this. ANY hint of point me to a right direction would be greate thanks!
 
assuming the I/O card is hardware, you would need a driver to communicate with the card. this would be provided by the manufacturer of the card. Then you need to figure out how to communicate with the driver. That would most likely get into Win32 programming and unmanaged code.

The manufacturer may also provide a .Net API library that you could use to communicate with the device. If that's the case life gets much easier. reference the dll in your project and pass the vales to the API.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
I received the I/O card and i read the manual on there it contains API library in c/c++ code and examples. If i wanted to communicate from my c# form to the I/O card do i modified one of these c++ example code (create a dll) and reference it in my c# code. I read i also need a (Pinvoke) method to communicate with c# to c++ ? Can you explain a little bit what i need to do exactly any info would be appreciated thanks.
 
the good news: you can interface with the card with .Net. the bad news: it's not simple. C/C++ is a different language. You can have your .Net code calling the C++ code, but now you are entering the arena of managed (.net) vs unmanaged (c++) objects, MarshallByRef and external DLL calls. What you want is possible, but not easy.

Before continuing with this specific task, I would spend some time learning how to call/release unmanaged objects and understand the common pitfalls and how to avoid them.

PInvoke is a low level command to invoke the process (method) you want to call.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top