Using a barcode to pull an image from a file location

Hello, can a barcode input be used in designer to pull a picture from a file? What would the scripting look like? I apologize I’m new to ignition. This would be used in Vision.

I would update your question to narrow down vision or perspective.

Updated. Thank you for the input.

I haven't had to do this in Ignition but I can hopefully point you in the right direction. In perspective you have a Barcode session event which can handle barcode scanning but you're looking at Vision. I think you probably want to use a keyboard wedge to send barcode information to Ignition and process that with a script.

There's a lot of ways to do this. The image control can load a local image from the machine. Documentation here:

A 2D barcode could store a path to an image but I'm going to assume you're working with a 1D barcode that is storing a number. If you are using a 2D barcode you simply put the path in the barcode and send the barcode input to your image control.

Typically what you'll do is you'll make a database or tag of type dataset that has a numeric PK field that the barcode refers to and a string field that stores the path to the image. Alternatively, you could store the image in a database as a BLOB instead of storing a path to the image. I prefer to use strings because I don't like putting BLOBS in databases.

The scripting would be called when a textbox receives a char like CRLF handle the barcode scan by looking up the scanned value in the database/dataset tag and returning the path as a string. That string would then be loaded into the path of your image control.

There is also a barcode control that you may want to have an operator scan. I haven't personally used this control yet but it might be useful for you depending on your use case. If you use a tag of type dataset then you could use that as a datasource for a template repeater which repeats barcode instances so you could dynamically generate barcodes for an operator to scan if you're scanning from the screen.

Can you also clarify file, is that in a database or filesystem, like on a local storage drive.

Yes, the file would be on a local storage drive.

Short answer is yes.

Depends on your needs. Start here system.file - Ignition User Manual 8.1 - Ignition Documentation

I highly recommend learning through Inductive University, it is free.

1 Like