General Category > Application Showcase

Controlling an entire machine as HMI and PLC.

<< < (2/3) > >>

timryder:

--- Quote from: bachphi on March 04, 2020, 12:51:05 PM ---Nice! Are BCR camera and laser head from Keyence? CO2?

--- End quote ---

The Camera is an SR1000 from Keyence and the Laser is an MD-X1000 from Keyence also.  Its a Fiber Laser Marker.

timryder:

--- Quote from: Sprungmonkey on March 05, 2020, 09:56:28 AM ---Nice work! I've seen those ADAM modules long time before, but always wondered how they work with no real time OS like windows. Are you polling data from it, of so at what rate? Do you use a background worker for this?

Asking because this is something I want to learn to do (multi thread and background workers), there are many applications I could use it.

AHMI has helped me a lot with its already made controls that does not require to write code for these, but now I was looking for do it myself in other drivers like for Siemens.

--- End quote ---

So from my main thread I call an initialization Function and check to make sure the Adam module , Camera and Laser can be reached by Ethernet.  From each check I start a background worker thread for each device where I continuously loop untill the main thread closes the worker threads. 

I'm polling the Adam module at 25ms interval and the Keyence at 100ms. I created a class for an input device which contains name, port, bit, state etc and I loop through and check/set all the inputs on the Adam.  Then I write to the Outputs in a similar fashion.

I also have a Auto Process thread which uses the input values and can also set the output states for the I/O conditionally.  I'd be happy to give you the code if you want.  It can use some improvement but it's a start.

Thanks everyone for your compliments!

Noe:

--- Quote from: timryder on March 06, 2020, 10:51:24 PM ---
--- Quote from: Sprungmonkey on March 05, 2020, 09:56:28 AM ---Nice work! I've seen those ADAM modules long time before, but always wondered how they work with no real time OS like windows. Are you polling data from it, of so at what rate? Do you use a background worker for this?

Asking because this is something I want to learn to do (multi thread and background workers), there are many applications I could use it.

AHMI has helped me a lot with its already made controls that does not require to write code for these, but now I was looking for do it myself in other drivers like for Siemens.

--- End quote ---

So from my main thread I call an initialization Function and check to make sure the Adam module , Camera and Laser can be reached by Ethernet.  From each check I start a background worker thread for each device where I continuously loop untill the main thread closes the worker threads. 

I'm polling the Adam module at 25ms interval and the Keyence at 100ms. I created a class for an input device which contains name, port, bit, state etc and I loop through and check/set all the inputs on the Adam.  Then I write to the Outputs in a similar fashion.

I also have a Auto Process thread which uses the input values and can also set the output states for the I/O conditionally.  I'd be happy to give you the code if you want.  It can use some improvement but it's a start.

Thanks everyone for your compliments!

--- End quote ---

Very nice! Sounds like it is exactly what I need to understand background workers. I'll take your word, I just sent you a PM.

bachphi:
I am a little bit leery with the door switch, since it concern with safety aspect.

timryder:

--- Quote from: bachphi on March 09, 2020, 05:20:22 PM ---I am a little bit leery with the door switch, since it concern with safety aspect.

--- End quote ---

Not sure what you mean exactly, but the door is completely interlocked with a redundant safety relay circuit to the laser marker.  The Laser will instantly stop and all output power is removed as well as a physical shutter moves into place in the path of the beam.  It's very safe.  As if that wasn't enough, we actually engage a mechanical lock on the door anytime the Laser output is on.  The customer can't even open the door while it's performing it's function. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version