01-16-2019 01:39 AM
Dear All,
For one of a test system, I need to write the commands with some 'transmit delay' in serial port for communicating with DUT. I could find a option for that in TeraTerm (as attached). Is there any way to add that transmit delay in LabVIEW serial port VIs? Please let me know.
Thanks.
Best Regards,
Sathish kumar D
Solved! Go to Solution.
01-16-2019 02:02 AM
Hi satish,
I need to write the commands with some 'transmit delay' in serial port for communicating with DUT.
What kind of "transmit delay"? How long do you need to delay?
You could transfer your string char by char in a loop, with some wait function in the loop…
01-16-2019 02:17 AM
Hi Gred,
I would need to have a transmit of 10 ms between chars. As you could see in that Teraterm GUI, there is a feature for that.. I am just curious to know if there is any option like that in LabVIEW.
Transferring the string char by char is the work around for solution for this need.
Thanks.
Best Regards,
Sathish kumar D
01-16-2019 02:20 AM
Hi Sathish,
As you could see in that Teraterm GUI, there is a feature for that.
I am just curious to know if there is any option like that in LabVIEW.
There is no such option in LabVIEW (AFAIK). That also is not a standard option with serial ports at all.
So I guess TeraTerm has implemented it in the very same way as I suggested you before: send one char, wait some time, send the next char, wait, …
01-16-2019 02:50 AM - edited 01-16-2019 02:55 AM
As Gerd has already said, such an option is not a feature of the VISA IO library.
But!!!!! LabVIEW, unlike Teraterm, is a programming environment and you can VERY easily program this yourself. As long as you don't need millisecond accuracy (which Teraterm couldn't guarantee either on a normal desktop OS), there is no problem in creating a loop and sending each character seperately with an accrding Wait Until Next ms Multiple node in that loop.
01-16-2019 08:49 AM
Here is an example .. i used wait instead wait until next ms ... or try a timed loop .... however with the OS and it's serial driver the time delay may vary anyway...
with some OS driver tweaking (buffer size, priority ,...) that could be improved but it should run like that.
(hope I don't end up in the Rube thread with that solution :D)
01-16-2019 09:00 AM
I am familiar with old hardware that was just fast enough to keep up but back then we used flow-control via hardware lines of X-On X-Off.
If your device support flow control and you can configure it to use it, it will let your device pace the serial transmission instead of the OS.
Just my 2 cents worth,
Ben
01-16-2019 09:54 AM
Thank you all for your valuable inputs; I will use a loop with ms delay to address my requirement.
Best Regards,
Sathish kumar D
01-17-2019 04:41 AM
@Ben wrote:
I am familiar with old hardware that was just fast enough to keep up but back then we used flow-control via hardware lines of X-On X-Off.
If your device support flow control and you can configure it to use it, it will let your device pace the serial transmission instead of the OS.
XON/XOFF or RTS/CTS may be a solution for some hardware. But without knowing about the capabilities of the connected device or DUT it is hard to say anything.
An intercharacter delay of 10 ms may be indeed just a workaround solution for such a device to avoid having to use its XON/XOFF capability or having to connect the extra RTS/CTS lines. But it could be also that the serial port implementation on the DUT is done in pure software over simple digital lines without real UART support circuit and that the device doesn't even support such handshaking capabilities. There is no way to know without a detailed specification for the device in question.
01-17-2019 10:39 AM
Heads up- depending on the particulars of your serial port, you may need to use Flush Buffer to force the write to happen after each character, otherwise it might "batch" them. It may work fine on one device but not on others, so if you NEED it to happen NOW then I'd flush your Write buffer after each character.
(But flow control is the better solution if your device supports it!)