Cognex In-Sight to HMI

sapoleon

Member
Join Date
Aug 2003
Location
salta, salta
Posts
315
Hi again.
I'm working now in an application that uses a Cognex camera. The camera have some 20 parameters for each product, and the speed of the product is 10 per seconds.
I'm using for this project Citect HMI, and I don't find there the possibility to read a end flag at that speed. So I'm thinking of a buffer.
The question is if someone reach a problem like this and how did you solve it.

Thanks
 
Cognex interface to PLC.

I have done several projects where I have interfaced Cognex cameras to various PLC's. If I understand your post correctly you want to inspect 10 parts a second, and you are looking at over 20 different points on each part. I am not sure that this will be possible using only a single camera. Keep in mind that for each part you need to trigger the camera, wait for the camera to process the image, and then give you a pass or fail result. Usually we are only interested in tracking the parts that fail, and making sure that they get rejected some where down the line.

Usually the logic is pretty simple, once the camera is triggered I configure one of the digital outputs as a busy signal from the camera, and then I configure one more as the pass, and yet another as a fail. Once I get the busy input, I do not allow another trigger until I receive either a pass or fail input. If I receive a fail, I set a bit within the PLC, which will not reset until the part has been rejected. If I receive maybe five rejects in a row, I will usually set an alarm bit to warn the operator.

You may be able to over come your time contraints by adding cameras at different points of your production process. I have learnt the hard way, that it is always better to review my application with the camera distributor prior to purchasing the camera. They can usually tell you how long the inspection will take, and which camera and lens combination will work best for your application.

I am curious as to what type of product you are inspecting?

Hope this helps.
 
BigAl,
The thing is like this, we are inspecting baby diappers (I think diappers is the word). They pass depending the type at a maximum of 8 per second (I use 10 to be a little more conservative). The camera proccess 20 tags in each diapper in 35 ms, and sends an output to a plc that make the rejection in case of need.
I'm not building the PLC logic and another person in the firma is making the camera logic.
What I'm building is a Citect application that will write to a .csv file the 20 values taken of each diapper.
The thing is that I don't see it possible to make it work directly with Citect because of the response time of the SCADA.
So I'm trying to get a solution. And I was thinking in a buffer, but I'm not so sure how big it should be...

The other thing, is that the person that is making the camera logic, tells me that he can not make a flag to be up to the HMI when there is new data, and that from the HMI can be then down so that he knows he have to give me more data in the buffer.

I don't know too much of the camera logic, but if you can help me with the flag, I'll greatly appreciate it.

Thanks for the answer
 
I dont see how you will get this to work straight from the camera. I dont think citect make a driver for a cognex.
The data is in the PLC so extract it from there to Citect, as that is what Citect is made to do.
Off the top of my head everytime citect starts I would start a new task in a "while 1 do" loop whose sole purpose is to
a) check if the PLC has new data in its registers
b) if so then call for a read of the data into citect (at this speed do not rely on citect keeping you up to date)
c) Write the data to your csv file
d) Sleep for 50 ms then allow the loop to continue
There is a lot more to it then this but it is probably the way I would go. If citect is not running then you will lose data and it will require a bit of programming in the PLC to say new data is available ie a flag that could be a number that increments every time new dipaer data is processed.
Regards Alan Case
 
Alan,
The Cognex camera provides an OPC driver. Citect reads directly to the camera OPC.
I don't have access to a PLC here.
In theory, Citect is running all the time. I have to add to a running project the new screens and the task.
What I didn't find was in Citect a task that can be run more than once per second.
 
Does Cognex have an Active X control? I know that DVT had one and Cognex and DVT are one now so I would think they would. This could be an option if its fast enough. If not I don't think OPC would be quick enough either however my OPC projects are few. You could setup a buffer in the plc. What you need to figure out is how often you want to update from the plc. This will tell you how much memory you will need in the plc. I'm doing some data collection at about this rate and size. I collect 20 data points every 20 - 50ms into an array 500 long. This gives me about a minute of data between uploads to the HMI.
 
Depending on the particular camera model (resolution vs.speed), a 100 ms per inspection with 20 parameters (how many vision tools? what kind?) may or may not work. One good way to find out how long does it take the job to process is to look at "Profile job" tool in "Sensor" menu. Anyway, at this kind of production rate, I would rely on camera's hardwired outputs to signal "job complete" and "pass". The only time when network communications will be needed is during changeovers, to download the data for the product.

Cognex In-Sight support Modbus TCP without any additional programming (just read the help file on how to address cells); it also has functions for Allen-Bradley communications and a generic, raw-data, TCP/IP. Yes, there is an ActiveX control to use from VB ar VC; ther is, of course, the OPC server. So there are quite a few options available.
 
Sapolean.

I have used Cognex Insight cameras on EthernetIP with Control Logix and the actual inspection rate could be possible with this setup but I would look at alternatives to using a CSV file to store your product data. With 20 parameters to log the CSV files are going to get very large very quickly and will rapidly use up disk space. In addition you might well find that it becomes impossible to open these very large text files using "normal" application software. I would consider using something like SQL Server for storage. In this case most serious SCADA packages will provide facilities for caching transactions to smooth out the data flow. I have not done this with Citect but I would expect such a capable package to be able to handle this.
Andybr.
 
Alan,
I'll try the continual task. I'll have to look that it doesn't eat the pc, but it's a nice idea.

CharlesM and LadderLogic,
I,ll see tomorrow if they have an activeX to be used. And how to use it. It could be a good idea. Because I didn't see in the Cognex OPC a time seting for data reading. I don't know how their OPC works... must ask also tomorrow to the Cognex people.

The camera is connected directly to the Citect PC with TCP/IP. A dedicated TCP/IP card for the camera. That was my request because of the time to take the data, I didn't want it to goes wandering in the plant offices. :)

CharlesM,
I don't have a PLC. Right now, we are experimenting in making a buffer in the camera. Also some 600 tags to get us something like 3 seconds.

Andybr,
SQL was always our first saying, but the client doesn't want it. For managing the csv files, we are making every day a new file. If they are still too long it will be every hour or something like that. They will have to erase them from the hard disk. It's their call. You know... the client is always right.
 
A separate task will be gentle on your PC. Use a startup cicode file to initiate the task but run the task in its own cicode file if that makes sense. Get the task to grab the data then sleep for the required time ie 50ms then allow it to continue in the loop.
If you need an example I can send you some code snippets. May take a while for me to get back to you as I will be on the road for a few days.
Regards Alan Case
 

Similar Topics

Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
145
Gents, We have the following configuration: A Beckhoff PLC with EthercatMaster > EK1100 with a EL6652 EthernetIP Master. Plan is to...
Replies
2
Views
398
Once in a while I am asked to look at some Cognex vision programming/cameras in our plant from 5 - 10 years ago. It seems every time I open up a...
Replies
5
Views
1,755
Good Morning , I'm new to Cognex Insight Vision Suite Software. When I connect to my 3 cameras , I only have 1 with the Spreadsheet tab...
Replies
2
Views
2,329
Good Morning , I tried to install Cognex Insight ViDi and suite on a Window’s 7 laptop , and it says it will only install on a Windows 10...
Replies
0
Views
1,567
Back
Top Bottom