01-31-2019 12:05 PM - edited 01-31-2019 12:11 PM
Hi Al,
I am working on NI-VISA to get information from analog interface DIGIFLOW-MINI1 by USB (this is RS-232 to USB adapter on CH340 chip, a driver for this chip is instaled).
I use a simple program (VI is attached) to read information from COM chanel. According to the manual (file is attached) I must to receive a string of 55 ASCII characters every 100ms, but I get only set of undefined characters (photo is attached).
Voltage is correct, PC found com port, windows 10, LabView 2016.
I feel that the solution is simple, but looking for the decision on the forums did not bring results.
If someone can help me out of this it will be great. Kindly forward me any support if you have worked on this issue before. Thanks in advance.
01-31-2019 12:55 PM - edited 01-31-2019 12:56 PM
Look at page 12 of your manual. It is quite clear that your Baud Rate is wrong. It should be 38400. You are using the default of 9600.
Furthermore, DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The device sends a termination character, so use it. You are already configured correctly to use it (defaults from the VISA Configure Serial Port VI). You just need to tell the VISA Read to read more bytes than your message. So I would go with something like 100.
01-31-2019 03:17 PM
You may also want to flush the buffer prior to entering the read loop depending on how long the instrument has been running. This way you will be reading the most recent responses and not data from hours, minutes, or seconds ago.
01-31-2019 04:48 PM
@Minions wrote:
You may also want to flush the buffer prior to entering the read loop depending on how long the instrument has been running. This way you will be reading the most recent responses and not data from hours, minutes, or seconds ago.
That does not matter. It only matters when your port happened to be initialized. But what you might want to do is read a message before the loop. You throw that one away, but you will now be properly synchronized to the messages.
02-01-2019 04:22 AM
crossrulz, many thanks to your advices. I will try it when I get to my the experimental stand.
02-03-2019 06:55 AM - edited 02-03-2019 06:56 AM
crossrulz, I tried your advices and faced to another problems.
I have got an information in hex (photo is attached) and I need to pull out of this set the following data: "mmmmmm", i.e. mean flow calculated over 1second in ASCII (range: -99.999 ml bis +99.999 ml) , this is written on pages 12, 13 in DIGIFLOW-mini1-CAN and RS-232.
I tried to do that with helping of "Spreadsheet String To Array" , but I failed (VI is attached). I think the problem is in determining of "format string". it will be great if you find time to help me!
Thank you in advance.