How to process barcodes from Datalogic Matrix scanner on Windows host? - c#

I'm about to purchase a Datalogic Matrix 300N fixed barcode scanner. I already downloaded and played with DL.CODE, this is the software to configure and emulate Datalogic Matrix scanners.
The idea is to collect and process the scanned barcodes on a Windows host with a Windows .NET C# application or service that has to be written by me.
As far as I can see now, the Matrix scanner could act as TCP Server and I can connect from my C# application (with TcpClient) to that Matrix TCP Server. However, there's no documentation or whatsoever available. Also I'm in doubt whether this is the right way to process barcodes in an production enviroment.
What would be the right way to set this up? Is "Matrix TCP Server" the way to go, or should I look out for other ways of communication? (ID-Net? Ethernet/IP? Modbus? Profinet IO? HMS Fieldbus?)

It seems that there are manuals of matrix_300n_reference_manual and matrix_n_family_host_mode_programming in the Manuals & Technical Literature column of Downloads for Matrix 300N.
Likewise, there appears to be the DL.CODE Configuration Tool etc. in the Software & Utilities column.
If you can not understand with them, why do not you contact Datalogic Technical Support?
or Contact Us?

You send a UDP broadcast to see which devices are present on a network and process the response. Once you have the device address you open a TCP/IP connection, hang async reads on it, let the scanner know via a send that you are listening, and process the async traffic received. While this is dependent on your receiving system., it is working in a client's production system at about 100 scans per second coming from multiple scanners.

Related

Communication between Desktop Application and Windows Mobile Compact Framework c#

I am writing a desktop application that will have to communicate with a windows mobile application in the compact framework 3.5. The communication must occur over the internet between these two applications to send data between them on command if the connection is available.
The system will send messages and objects like Images between device and desktop application and check to see if the desktop can see the device by sending a command and have a timeout on response. (Application will then know that the device is not available).
The mobile device will send a message to the desktop application when online as well that the desktop knows that the mobile is connected(Type of registering for communication)
Can someone please inform me of the best way to follow to accomplish this.
I did some research and found this site is near to something like event based driven communication I would want but do not have the availability of setting up an email on each device.
Battery life and internet open on device is not an issue.
Should I check in on working with the System.Net.Socket class for this type of communication between the two application and if so how will I set up so firewalls will not interfere and have my desktop application be seen over the internet by the mobile application ?
Hope someone can spread some light over this for me, if you have a answer please provide a link so I can read up on it.
your description is something basic. OK, regardless of what TCP/IP communication you decide for (HTTP, sockets) you must always have your internet router forward packages on a specified incoming port to your PC and the firwall must accept these incoming requests.
So, the device will have to send data to the PC and vice versa. So you need a server and a client on the PC and on the PC.
Possibly you can use an already available cloud like Dropbox to exchange files between PC and device.
What are about your skills in socket programming? The main server (PC) must be written multithread to be able to server multiple device client requests.
A simple socket comm is done in my SocketWedge [http://www.hjgode.de/wp/2010/05/27/transmit-data-from-winmo-device-to-pc-socketwedge-and-socketsend/]. A way of multithreaded communication using a web server on the device is available here [http://www.hjgode.de/wp/2012/10/19/windows-mobile-a-simple-web-server-with-extended-features/].
Will SQL with data synchronization be a possible choice?
Can you describe the application in more detail?
~josef

Idendifying caller number. What is the easiest way?

I have PC and VOIP phone. When someone calls to my account and I answer it using VOIP phone, I want the phone number to be stored on my PC.
What is the easiest way to receive caller number? Is finding a VOIP Java/C# SDK and developing my application (just to get a caller number) the only way or are there some clever shortcuts?
Note: I am familiar that softphones are displaying the callerID but there is no (reasonble, non hack'ish) way I can read it from softphone.
Depending on your softphone you might be able to configure it to save a calls log. Alternatively you could obtain CDRs (call detail records) from your VOIP server.
Another route to go would be to monitor incoming VOIP TCP connections and extract caller data from sniffed packets.
Or you could write a small program that will run in background and check periodically which is the active window. If the active window is your softphone, then it will take a screenshot and dump it to a folder.
What Vlad said. Providing the hardphone model details will get you more details :-)
If the PC is sure to be on all the time you want to operate the phone, you can install a simple SIP proxy on the PC that does nothing but logging.
If a softphone is an option, many of them can be scripted, I love twinkle for example.
Using wireshark (or more to the point tshark, the command-line version) you can build a capture spec that will only capture incoming SIP packets on UDP port 5060, and then only if the SIP msg is INVITE. Then you just have to look at the "From" line to see who called you (if it's filled in; it should at least have a number).

How do I Control a Device’s Embedded Control Software in C# using HTTP?

I have a piece of hardware with an embedded user control accessed by typing the device's IP Address into a web browser. The device is connected directly to my PC via x-over ethernet cable and static IP's. I need to integrate the control of the device into my C# application.
My thought was to use a packet sniffer to monitor the traffic between my PC and the device while at the same time playing with the device's controls in my web browser. Then finding out which packets that my PC is sending correspond with which controls I am using at that time. Then I can create a class of HTTP or TCP packets in my C# application and send them to the device using the Socket class.
However, I dont have much expereince with network protocols, so when I am using Wireshark to monitor the traffic between my PC and the device, I am not sure where to even start when finding out which packets do what. Does anyone have any ideas? I am open to anything. Thanks!!
EDIT:
Its hard to explain exactly what my device is, but its basically an elaborate sensor and typically used in industrial applications, so it could likely be using Modbus, which I am moderately familiar with. Do you know how I can tell which protocol is being used by examining the packets? I noticed (using Wireshark) that the packets being sent from my PC to the device occur in a pattern of 1 HTTP packet, then 5 TCP packets and repeat that same sequence as long as the control is open in my browser. Are there any resources that might give me a better understanding of what is going on?
If this is browser controlled, my first thought would be to examine the web pages the device sends to your browser and see what the browser is instructed to do when you manipulate the controls - this seems much easier than messing around with Wireshark.
Is there something I'm missing that makes this impossible (such as a Flash-based control system)? If it's just done with HTML or Javascript, and HTML POST messages or something a bit more sophisticated like Ajax, it should be relatively easy to work out the interface.
Depending on the device it will either be using a variant of the modbus protocol (http://en.wikipedia.org/wiki/Modbus) or something obscure and propriatory.
The best thing to do is to keep sending the same command to the device over and over again until you can recognise similarities in the packets.
If it is propriatory it will probably be something simple like a command/data pair or possibly an XML blob. If you're really unlucky it will be compressed or encoded but unless you're hacking a game or a cash machine this is unlikely.
Asking the manufacturer of the device if they can give you the spec often works as well.

What's a good way to copy files from a PC to a Windows Mobile device?

I have a C# application running on a server, and it needs to copy files out to multiple Windows Mobile 5.0 devices. These devices are connected to the network directly via Ethernet-enabled cradles (so they are not connected to a PC via ActiveSync).
What different options do I have for doing this? I know RAPI can do this, but I'm not sure if it can copy something directly over the network like this. Also, I know RAPI uses ActiveSync DLLs and thus requires ActiveSync to be installed, and we would prefer to avoid doing this if possible.
Is WMI a possibility? Can we use ordinary File.IO if we can somehow get the IP address of each device? Code samples or general knowledge would be most welcome.
Normal file I/O isn't going to work. The devices don't have file sharing OS components, so you can't "browse" to them over the network like you might a PC.
RAPI does use ActiveSync, so not only do you have to have AS installed, the devices must also be actively connected, and ActiveSync only allows one device connection at a time, so it's not going to work for what you want.
My solution for this type of scenario has always been the same. You have to install some sort of "listener" on the devices, whether it is your deployedd app or some form of installer. Sometimes I use an autorun app on an inserted CF/SD card (all depends on your topology).
I usually have that app listen for a UDP broadcast of a "discover" packet from the PC. When they receive it, they in turn UDP broadcast out their IP address and the PC collects those. The PC then sends the files via a TCP socket to the device(s) through the listenner app.
Lately I've been doing all of the device-side pieces via a REST service hosted in Padarn to minimize the amount of comms code on the device I have to write, but you could do it all with Udp/TcpClients without too much difficulty.

Getting a notification when my system freezes

I have a minor problem where my (new) computer tends to completely freeze up. Am not sure when it happens exactly but the 6 times that it did happen during the last 4 weeks, it could have been related to a very long rendering task that eats up lots of RAM. (Am actually pretty sure that this rendering engine is causing this problem.) Anyway, I don't really care about what causes the problem. I can repeat it by having the same image rendered again and waiting about 4 hours for it to finish. And I can avoid it by making a minor adjustment to the rendered image which somehow seems to solve it all. It's likely a bug in the rendering engine.
And when I say Freeze, I mean that everything stops responding. Keyboard, mouse, disks, they all just stop and the image on my screens are frozen. I don't get a BSOD or automated reboot.
I don't mind the freeze-up, but I would like to receive a warning when the system does freeze up. So I was thinking about a simple solution that should warn me when it does freeze up again. To do so, I want to use an old SmartPhone (HP IPAQ) which runs Windows Mobile 6 and connect it to my computer through one of the USB ports. It would just continue to communicate with my computer to check if it's still alive. When the computer doesn't respond for 5 minutes, it will assume the system is frozen and would have to send a signal to me. Basically, I want it to send me an SMS message to my other phone. Well, consider the SmartPhone to be a kind of lifeguard...
Anyways, I am quite familiar with software development, just don't know where to start with this application. I will be using the .NET Compact Framework and need some pointers in the right direction to do the following:
1) How to connect to a service on another PC using the USB connection and not some wireless Internet connection? (And definitely NOT any Internet over GSM options, since it's just a prepaid card that I'm using for this phone.)
2) How to send an SMS message from this phone to my other phone?
3) Are there already some existing solutions similar to this thing I just came up with, which could save me some time programming?
I used to have an iPaq pocket pc and based on what i remember when you hook them up to the pc they pick up an IP address.
That IP address is the key to your problem,
your computer could ping your pocket pc's ip as a heartbeat. that way you can be sure that you aren't going through GSM since the Desktop is calling the handheld. How to: Create a Socket Listener your socket listener would be listening on your pocket pc if it doesn't get any messages in a set period of time it would trigger the alert winch would send out your SMS.
You could also do the reverse, where your pocket pc would be pinging your desktop, just make sure that you are using the local IP to avoid traffic over GSM
Sending SMS using compact framework
Send SMS Sample
1) You can connect to a USB port as a COM port - many examples on how to do this especially around using GPS. Write an app for your pc to listen to USB for a message and respond. Write the app on the phone to periodically send a message to the PC and get a response.
2) There should be an API for the phone to send an SMS.
3) Not that I know of, the closest being anything that communicates on USB such as I mentioned with GPS-enabled devices.
Good luck - I know (since I have worked with all the technologies you are talking about) that I wouldn't have a problem making this, but for those without that experience it could get tricky.

Categories