In the following post we will see how we can display a barcode in our SCADA, in this example in AVEVA Intouch.
If you are using my dear WinCC, Factory Talk View, IFIX, or any other type of SCADA that supports .Net controls, the operation is the same or should be the same, as long as the object itself is embedded, since the Scripting language of these is not .Net unlike AVEVA's System Platform, from which the ArchestrA Graphics / Industrial Graphics are inherited.
First of all, thanks to Brad Barnhill for this library that you can download here or a build here.
Once we have the library barcodelib.dll, we will register it in our project to be able to use it.
We make an import of Script Function Library
We select the location of our library
And the result should be like the following. As additional information, by performing these steps, a copy of the library has been made to our project, so when we deploy it on the client, it has all its dependencies.
The next step is to create a new object that I have called PHSBarCodeLib and we are going to insert a .net object of type PictureBox.
To insert a PictureBox object, you must have previously imported the library System.Windows.Forms.dll
If you have any questions, here you have the procedure, the only thing is that it updates to .Net Framework 4, since 10 years have passed since the previous example ;-).
We are going to create a property for our object, which will be the variable that we will pass with the barcode
And every time that property changes, we will execute the following code.
dim barcode as BarcodeLib.Barcode;
barcode = new BarcodeLib.Barcode();
barcode.IncludeLabel = true;
'PictureBox1.Image = barcode.Encode(BarcodeLib.TYPE.UPCA, code);
PictureBox1.Image = barcode.Encode(BarcodeLib.TYPE.UPCA, MyBarCode , Color.Black, Color.White, PictureBox1.Width, PictureBox1.Height);
We instantiate our object and we can now test its functionality.
Functioning perfectly and with several barcode formats!!!
Thank you very much Brad for this library :-)