Presentation and help to choose logic analyzer - Page 1
Forum section: electronics / beginners

author: jugosali
author_rank: Newbie
timestamp: December 02, 2016, 06:51:52 pm
content: Hi allI've been following Dave's adventures for loooong time, and registered earlier this year in the forum. Usually the answers to my questions are already here. A bit of search does the trick. Today I can't find the clues what I'm looking for, so I ask for some help.Here is the story.I have a system that consists in three hooked equipment working together.-A printer-A machine CNC like that moves the printer-A computer that controls both machine and printer.The bloody thing mostly works fine but hence a while it misses a label or duplicates the last one. The printer guy blames the machine one, and the machine guy blames the software developer and the software developer blames everyone else. And here I am in the middle trying to sort this out.My plan is to log all the communication signals and events on the system and with that proof just put the people to work and get it fixed.I have never used a logic analyzer and I have some questions before buying one to debug the thing:I need to log:-A trigger signal +15v (Print signal)-An encoder signal +15v (Print speed)-Sniff the printer serial port RS-232. (Label data)Should I convert every signal to 5v for the analyser?How long can I log continuously? Is an event that can happen once every hour or so. The amount of data in between is fairly small, a hundred or so events per hour. Also the speed is not high. 9600 for the serial port and around 20Khz max for the encoder.Can I feed the 232 signal directly to the analyser or needs conversion as well?Is better to get an MSO or maybe an Analog Discovery, Saleae or similar.I've been playing with the demo of the Pulseview software and I wonder if the Rigol DS can feed the data into that software live. This looks convenient enough to me.If you have read this completely, thanks in advance.

author: Buriedcode
author_rank: Super Contributor
timestamp: December 02, 2016, 07:47:28 pm
content: Can say I read it completelyLogic analyzers generally allow any signal to trigger reading in the states of all its inputs. This can be rising, or falling edge, and can be multiple input conditions.The limit of how much it can 'capture' is down to its memory, so the faster its input capture, the shorter the period it can capture. Because of this, often you want to run it at the slowest speed possible to capture the events you're interested in. For example, serial, at 9600, then you could get away with 100us, but probably want 20-50us. But if you suspect glitches that can be two rising edges that are meant to be synchronous, you can ramp up the speed and capture events in the range of nano seconds (depending on the max capture rate).You mention several signals, most seems slow, so you might not need to capture in the MHz range, but if there is say 5 seconds between two events, then if you capture 8 channels at 1us.. in 5 seconds thats 5kbyte's. Often analyzers will have much greater memory than this but you see my point. Most modern small analyzers simply capture and buffer the input states and send them to a PC - used as a nice GUI. The PC can of course store this, and if the datarate between the analyzer and PC is faster than your capture rate, then the PC will capture *all* the data for however long you run it for.In terms of voltages, whilst there are proper methods for scaling down voltages, not logic analyzers have fairly high input impedance, so you could probably get away with a simple resistor voltage divider on the inputs that are greater than 5V, or just a series resistor with diodes to clamp the input to 5V +/- 0.6V. This can slow down edges but as you're not looking at anything particularly fast it shouldn't matter too much. I imagine most analyzers will have input protection anyway, so you could get away with just series resistors - but this is no guarantee. Best bet would be a simple NPN transistor with a pull up. This will invert the signals of interest, but does the job (and makes it easier to read RS232 bytes as they are inverted anyway).Depending on how electronics savvy you are, it might be a better idea to use a microcontroller to capture the serial, the frequency and possibly duty cycle of the encoder, and log other trigger events. Each time it captures any data (for the serial) and adds a time stamp. Stream this to the PC so it can log all the events in a CSV/text file. This doesn't actually solve any problems you may have, and would spit out very large files (read: lots of scrolling to find anything) but at least it will all be logged. For the msot par though, I'm sure a logic analyzer would be the first port of call and I'm sure a Saleae is more than capable of continuously capturing events and storing to a file for later analysis.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: December 02, 2016, 08:22:09 pm
content: If it were me, I'd add some voltage conversion (resistor dividers for 15V signals, RS232->TTL UART adapter for RS232, and then use something like the Saleae LA. Your data rate and measurement time means you almost certainly can't use a stand-alone option, the memory depth won't be anywhere near what you need. One really nice thing about the Saleae units is the interface software compresses the data, so you can sample much faster than necessary but only use up the memory required for the actual data rate. For example, if you have a 20kHz encoder, 20kHz trigger, and 9600 baud RS232 Tx/Rx, you could record over 3 Hr of data per GB of available RAM in your computer, even if you're sampling at 50 MHz (the high sample rate helps to catch irregular and narrow spikes).

author: jugosali
author_rank: Newbie
timestamp: December 02, 2016, 09:11:26 pm
content: Thank you both for your replies.I see it much clear now.Is sad I cant use the Rigol + Pulseview software for this. There is not many occasions when the company gives you a blank check to buy the needed stuff. Money is not a problem though, is more that I need to justify the use.Any advice about a good USB LA with scope that can record for long periods (maybe 5 min or so)? Or better going straight to a Saleae Pro 8 or Pro 16?

author: Harrkev
author_rank: Contributor
timestamp: December 02, 2016, 09:31:41 pm
content: Quote from: jugosali on December 02, 2016, 09:11:26 pmHaving used a Saleae Pro 16 (one on my desk right now), I can say that I am not a fan. The analog stuff "works" but it is a poor substitute for a scope. You get no graticules, so you have no idea what the voltage is without mousing over a sample to see the voltage. If the shown signal between 3.3 and 0V, or is it between 0.5 and 0V? Hard to tell at a glance. Also, unless you are sampling, you have NO indication of what the current logic levels are on any of the lines (HP logic analyzers always show you high/low conditions of all lines).With that being said, a Saleae would actually work for what you need (if you add RS-232 -> TTL converters). If you intend to use whatever you buy later, look a Analog Discovery. If it can sample at a low rate for a long period of time (no experience, to check first), then that would be a great choice.Or, as another poster mentioned, use any handy micro that you have lying around. More work with this method though, and you don't get a shiny new toy.

author: jugosali
author_rank: Newbie
timestamp: December 02, 2016, 09:38:05 pm
content: ThanksI also had a look to the analog discovery and it bundles more features, bum I'm not sure about the LA software side.Have some dev boards, a raspberry pi and such, but the boss is keen to expend some money... I'm not loosing this chance.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: December 02, 2016, 09:53:48 pm
content: Quote from: Harrkev on December 02, 2016, 09:31:41 pmYes, the analog portion of the Logic Pro is absolutely no replacement for a scope. I view it as a logic analyzer "plus", meaning its primary duty is as a LA, and the analog sampling is only there to support that (eg: temporarily turn on analog sampling so you can verify the signal is going all the way to logic 1 or 0, versus floating around the detection threshold). Beyond that, the analog sampling is mostly useless. For analog work one should be using an actual scope, no questions asked. For actual LA duty though, I find the Saleae units hard to beat.

author: danadak
author_rank: Super Contributor
timestamp: December 02, 2016, 11:02:40 pm
content: This might work, quite cheap, works off Saelae software (free download).You would have to scale voltages. The advertised data rate I am not sosure solution can meet. but "normal" serial/parallel PC port stuff should be OK.This is just one of many similar on ebay -http://www.ebay.com/itm/New-Set-USB-Logic-Analyzer-Device-USB-Cable-24MHz-8CH-24MHz-for-ARM-FPGA-/261926397359?hash=item3cfc07a5af:g:FRwAAOSw3xJVelPRRegards, Dana.

author: rstofer
author_rank: Super Contributor
timestamp: December 03, 2016, 12:59:09 am
content: For a first cut, I would split out the RS232 and run a separate signal to another PC that receives and stores the traffic.I might use puTTY on Windows or just 'cat' on Linux. After the 'glitch', you will know exactly what was sent. That cuts the problem in half.If you wish, you could just take the serial output away from the machine control and read it back on the same PC (maybe), or another PC. There is no reason to have the machine hooked up unless you thing electro-mechanical interference is a problem.Spending money is good! But it might not help you solve this particular problem.

author: jugosali
author_rank: Newbie
timestamp: December 03, 2016, 03:04:56 pm
content: Quote from: danadak on December 02, 2016, 11:02:40 pmThanks.I´ve just orderded one to try.

author: jugosali
author_rank: Newbie
timestamp: December 03, 2016, 03:17:00 pm
content: Quote from: rstofer on December 03, 2016, 12:59:09 amThanks for your approach. I have a RS-232 sniffer and putty at hand all times. It solves a lot of questions.But the thing is more complex than this.-First the software sends the job to the CNC, which has a buffer.-Now the software listens to the machine returning an specific label command to know when is processed and then sends the right label information to the printer.-After the return command has been send another command activates the printer head module at the machine and sends a trigger signal to the printer + a pulse stream to sync the speed.-Now the printer know what label to print (RS232 from the software). When to print it (trigger from the machine). And the print speed (pulse stream from the machine).As you can see there are several things happening at the same time, an one of them is not right sometimes. And this is the real issue, this happens very randomly and was a small nuisance at the beginning. But after some months of this, a lot of wasted time has been added up. Somebody is not happy.

author: timb
author_rank: Super Contributor
timestamp: December 03, 2016, 11:16:34 pm
content: Quote from: jugosali on December 03, 2016, 03:04:56 pmPlease don't use the Saelae software with that. Especially if your company would have paid for the actual Saelae hardware...They release their software for free and it's meant to work with their hardware, not cheap Chinese clones. Unfortunately, there's no way for them to easily prevent this.They're a small company trying to make a living off this. If you want to use their software, please support them by purchasing their hardware.

author: jugosali
author_rank: Newbie
timestamp: December 04, 2016, 11:43:12 am
content: Quote from: timb on December 03, 2016, 11:16:34 pmSure I wont.I just paid this one with my money and plan to try the Pulseview software, that I understand is opensource. Just for the fun of learning a bit more.Of course, whatever solution I choose, the company pays the full bill. Even If I got a Rigol at the end, I´m not bothering to hack it.I fully understand the difference between a home "educational - hobbyist" or professional for profit use. I appreciate you raising the point, and would like to extend it to anybody else reading this.

author: jugosali
author_rank: Newbie
timestamp: December 04, 2016, 11:49:57 am
content: Quote from: wilfred on December 03, 2016, 11:43:11 pmThanks for your brain squeeze into this.The printer has a buffer that retains the last label, if no new label is received it duplicates the last one as soon as a trigger and encoder signals are received.As you say I'm heavily inclined to a software bug, but until I cannot demonstrate with facts I have three people blaming each other. That is why I just want to collect all the data and collate it together.You mention the analyser just getting comms at UART level. That points to me I will need a 232 decoder (max232 or similar) at the sniffer end? I'm only interested into the computer TX side, so no need to decode TX from the printer.

author: ieast
author_rank: Newbie
timestamp: December 04, 2016, 05:11:24 pm
content: QuoteRealTerm is far superior to Putty for investigating most kinds of serial comm. You might want to check it out if you haven't already.http://realterm.sourceforge.net/If you're using a Saelae or similar logic analyzer, you'll probably want to keep voltages to 5v or less.http://support.saleae.com/hc/en-us/articles/208667006-Explanation-of-Supported-IO-voltages-Voltage-Thresholds-and-Over-Voltage-ProtectionYou could probably use a MAX3232 transceiver to convert RS232 into 3.3v or 5v TTL logic. There are a lot inexpensive breakout boards available since these are commonly used by the Arduino/RaspberryPi/BeagleBone/etc... community. For example:https://www.sparkfun.com/products/11189