Hello.
My current project is to evaluate using a Beckhoff BC9000 (Ethernet Bus Controller) as a data-logging system. We will be using one 2-channel 4-20mA analog input module and one 4-channel thermocouple input module for evaluating our manufacturing process.
Assuming the goal is to graphically display the 6 varying inputs (pressure and temperature), the simplest solution I have come up with is to have a small program on the BC which loads the inputs into variables on the BC, then have a Visual Basic program poll the BC once per second (or so) and output the values to a flat file for loading into Excel. Does this sound reasonable?
Actually, the goal is to evaluate and optimize the setup on one machine, then setup the other machines identically to the first.
So far I've been able to get the BC on the network, download a program and get it in run mode. The program's only purpose is to set a variable. (All using TwinCAT PLC)
I have been able to write a simple VB program using the AdsOcx active-X control, but I have not been able to get the BC variable into a VB variable. (Using VB 5)
I've been reading the plentiful documentation including the exampe programs but to no avail. I think I must be close because when my VB programs executes the read-variable-from-plc part, the BC and the network lights flicker.
Anyhow, does anyone know what I'm talking about?
Am I on the right track?
If so, would you be interested in answering some more specific questions?
Should I go ahead and post them here?
Thanks.
Jim
Feb 14 2004, 10:06 AM
I have managed to write a Visual Basic application to commuicate with a Beckhoff BC9000, if anyone is interested I will post some code. It's not hard once you the hang of it.
My program just requests the values from the BC9000 memory once a second and writes them to a CSV file for importing into Excel. Simple and small program , but it does what we need.
Guest_rock
Feb 28 2004, 12:23 AM
| QUOTE (Jim @ Feb 14 2004, 10:06 AM) |
I have managed to write a Visual Basic application to commuicate with a Beckhoff BC9000, if anyone is interested I will post some code. It's not hard once you the hang of it.
My program just requests the values from the BC9000 memory once a second and writes them to a CSV file for importing into Excel. Simple and small program , but it does what we need. |
could you post file
been looking at the beckoff cx1000 line, but not quite sure how to connect and use a hmi package to it
[QUOTE=Guest_rock,Feb 28 2004, 12:23 AM]My program just requests the values from the BC9000 memory once a second and writes them to a CSV file for importing into Excel. Simple and small program , but it does what we need. [/QUOTE]
could you post file
been looking at the beckoff cx1000 line, but not quite sure how to connect and use a hmi package to it[/QUOTE]
This is an example right out of the manual.
Dim VBVar As Long
'Read value
Call AdsOcx1.AdsSyncReadLongReq(&H4020&, 0&, 8&, VBVar)
'Display variable
Label1.Caption = VBVar
You'll need to create a VB project, add a form, and install the ADS-OCX VB component. And set the server and client addresses in the ADS-OCX properties.
' Here is the stripped down core functionality from my code
For i = 0 To 5
j = i * 4 + 2
Call AdsOcx1.AdsSyncReadIntegerReq(&HF020&, j&, LenB(Var), Var)
Print #1, Var; ",";
Next i
print #1,
It simply reads from the BC9000, and writes the value to a file.
Of course the devil is in the details. You'll need to do a lot of reading in the TwinCAT Information System. You'll want to look up "index group" and "offset" for the memory locations (HF020). And you'll need to look at the docs for each card to see how the unit organizes the cards in memory to get the offset values.
Hope this help.
greyl0rd@yahoo.com
AcqMan
Mar 3 2004, 10:22 PM
Jim, you are on the right track. You could've saved some serious time by talking to Beckhoff U.S. Support. They have some ready made examples using the AdsOcx. I have had very good experiences with them.
I'm with a small company in MN that has used some Beckhoff I/O for Data Acquisition. We started out using the AdsOcx, but then ran into an outfit that had designed a system that could do everything without even having to buy TwinCAT. They archive the data to SQL server and provide some pretty slick tools to visualize everything.
Basically it saved us some serious time and money in the long run, so that may be something to look into.
Guest_eric
May 19 2005, 04:32 AM
| QUOTE (Jim @ Feb 14 2004, 10:06 AM) |
I have managed to write a Visual Basic application to commuicate with a Beckhoff BC9000, if anyone is interested I will post some code. It's not hard once you the hang of it.
My program just requests the values from the BC9000 memory once a second and writes them to a CSV file for importing into Excel. Simple and small program , but it does what we need. |
is it posible for me to retrieve data from the Beckhoff BC9000 and save in the MS access database....or can you post the coding .... thanks a lot...Jim
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.