10-28-2008 12:27 PM
Hi
I found the common problem when I want to record from a multimeter (RadioShack 22-168A) with RS 232. I searched two days, but I can not solve the problem.
The serial port and the instrument are working which had been checked by Basic Program. See below
10 OPEN "COM1: 1200, N, 7, 2, RS, CS, DS, CD" AS #2
20 A$="D"
30 PRINT #2, A$
40 IN$=INPUT$(14, #2)
50 PRINT IN$
60 CLOSE #2
70 END
Note: Give the meter the D command to active data transmission
But When I try to operate it by LV 8.0, there is a read error
When I increase the timeout, the error code changed to -1073807298.
I also tried to type "D", "D/r", "D/r/n" and so on, but it was not working.
Solved! Go to Solution.
10-28-2008 12:41 PM
10-28-2008 02:09 PM
I'm sorry. I did a mistake when I type word for this message. Actually, I type the correct syntax in LV, "\r", "\n" or "\r\n"
The problem did not be solved .
10-28-2008 02:49 PM - edited 10-28-2008 02:54 PM
Are you SURE you actually sent a carriage return character on you VISA write? We can't tell from your screenshot because if the Write string is in Normal display, you won't see the carriage return. If it is in \code display like SMercurio said, it would show up as D\r.
In NI spy it would show up as 17.
VISA Write ("COM1", "D." ) Process ID : 0x00000144 Thread ID: 0x00000664 Start Time: 15:50:29.610 Call Duration 00:00:00.015 Status: 0 (VI_SUCCESS)
Notice D. where the period represents an unprintable character. If \r doesn't work, try \n
10-28-2008 02:57 PM
10-29-2008 04:48 AM
The problem is also here.
I have tried to use Advanced Serial writr and Read.VI and Basic serial write and Read.Vi, and typy in D, D\r, D\n, D\r\n as well as Dennis Knutson said set 'End write with termination character' as A or D. But all of them are not working.
It return -1073807298 when I used Basic serial write and Read.Vi , and return -1073807339 when I used Advanced Serial write and Read (time out 20000ms)
10-29-2008 08:30 AM
10-29-2008 09:16 AM
It's been a very long time since I've use basic code. What are those switches after the stop bits (RS, CS, DS, CD)? Are those to use or not use the handshaking lines?
For a sanity check, you should try using a common terminal emulator program such as Hyperterminal and see if the communication works there.
10-29-2008 09:27 AM
Could you show me how to do in detail
Thank you
10-29-2008 09:39 AM - edited 10-29-2008 09:40 AM
Start>Programs>Accessories>Communications>Hyperterminal.
This is a standard windows program that has been around for years and years.
You also did not answer the question about the switches in the basic program. Is this a program you wrote or got from somewhere?