I’m currently planning to implement our first barcode scanner project. In short, I need to have our final inspector scan 3 separate barcodes that were attached to the product during the manufacturing process. This will provide traceability from the product serial number down to the raw materials used in process. I would like the data from all 3 scans to become one row in the database. (MySQL)
I saw the news item about the available UDP Plug-in and have downloaded it. The news item said that FactorySQL’s string manipulation function can be used to clean/parse the data. I haven’t been able to find any detailed information on where this is or how to use it.
I also read a previous post which described using Kepware’s U-CON driver to set up a barcode scanner on the network. Do I HAVE to create a driver using U-CON in order to accomplish this?
First off, the UConn server is an alternative to the UDP plugin approach, and isn’t connected in any way. UConn provides much more flexibility and power, but obviously you pay for the power.
If the UDP plugin will do what you need (primarily: ignoring any formatting, if you’re able to get some format of the data you need into FactorySQL), then that should work fine. The string manipulation functions are defined in the User Manual under Technical Information>Base scripting library>String functions. What the article intends is that you can use the IndexOf, LastIndexOf, Substring, etc functions to strip off unnecessary characters and clean it up a bit before inserting it in the database.
Your desire to store it in three columns of the same row is fine. How you do it will depend on how the data comes in: most likely you’ll need three groups, one for each scanner, which records the barcode to the appropriate column. You’ll probably use the dynamic where clause option on the group to get it to write to the correct row.
Hope this helps out a bit, I didn’t want to overwhelm you with fine grained details, so if you have any other questions, please ask!
OK - I downloaded the UDP plug-in and confirmed that it created the Network plugin Config file with port 5507 in the script.
I also installed the ES1A serial to ethernet converter with the scanner connected to the module’s serial port. The scanner was tested with hyperterminal and is sending out string data when a barcode is read. All serial parameters have been set to 8N1 with no flow control.
I set up a group in FactorySQL called Scanner and configured an action item with the command getLastValurForPort(5507). This created a grey tag with the value Bad-Unknown. When I start the group, the value goes blank and the tag is still grey. When I operate the scanner, nothing happens.
The ES1A module is browsable and I’m able to configure it to transmit to port 5507 at the IP address for the computer running IA software. I also updated the module’s firmware and rebooted to no avail. Any further help from here would be greatly appreciated.
To be clear, you tested with hyper terminal connected directly to the serial port? It sounds like you have everything setup from the FactorySQL point of view. As a small point of clarification, your tag is “gray” because its not set to write to anywhere- it’s considered “read only”- not because it’s running or not.
I would take a look at the configuration of the serial-to-ethernet device, and make sure that it’s set to send correctly- often it’s configurable to only send under certain conditions (time delay, amount of data, newline, etc). Look it over and make sure it’s actually sending it out.
It seems to me that we might have a simple test tool around here that lets you send data to verify FSQL’s operation and open a port to watch incoming data, but I’ll have to look around for it. You could also try using a packet sniffer (like Wire Shark) to see if the data is coming in, but in my experience that’s a bit of work.
Oh, and don’t forget to make sure you don’t have a firewall blocking the incoming data.
Hope this helps, and I’ll post if I find that tool.
Grrrr… It was the Windows firewall. Once I added UDP port 5507 into the exceptions list, it worked like a charm. I should have known - hate it when that happens. Thanks for the help!!
Haha, awesome. It’s usually the simple things that get in the way.