Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

rs-232 communication

Thanks JLS. It is so useful. According to your suggestions, I wrote the VI as you can see in the screen look. Please, correct me if some think is wrong. I could not save and monitor it into front panel.

ssalih
0 Kudos
Message 11 of 29
(2,324 Views)
Hi JLS

Thanks, your respond was very much useful. In fact, I am still having difficulties. I was thinking that it is not much tricky but I may be new user for VIs. Do you have/know some example VI written in 6.0? Or can you statemore clearly(step by step)what you wrote? Deadline for this is so close, I like to end it.

ssalih
0 Kudos
Message 12 of 29
(2,319 Views)
Hello,

In order to help you write your program with any more specificity, I'll have to know more precise details of the command you write and what you expect to receive. One thing to note is that you need to actually write two properties to enable/disable termination. You shouldn't even worry about this though, just the use the VISA Configure Serial Port VI to do it; it is really just a property node underneath which sets the appropriate properties to achieve setting the parameters you see as inputs. I have attached a screenshot of how you can format your program to write and read, while setting all the serial preferences you like. It will work for a loopback test, write out whatever is in the write string, and read back the response 1 byte at a time. This should give you a good idea of how to read back your response in arbitrarily sized chuncks. You can use a While loop if you will iterate an unknown number of times.

Hope you're getting closer!

Repost if you need help!

Best Regards,

JLS

Note: I many not see posts in real time, that is the reason for the delay in response time 😞
Best,
JLS
Sixclear
0 Kudos
Message 13 of 29
(2,306 Views)
You've got two threads going on the same question. That's usually considered a bad thing. Did you read the response I gave to the thread here? Your string parsing is totally incorrect. I could help you more if you were to post a VI with actual strings returned as opposed to just a picture.
0 Kudos
Message 14 of 29
(2,304 Views)
Dennis,

I am really sorry about this. It is my bad. I was doing VI long time ago and trying to remember some stuff. More than that, the issue has to be done in short time. Hope you and JLS can understand me. Having LV 6.0.. and using serial port give me difficulties.

I did a new one according to your thread.

I did not get rid of the unprintable character(s). Working on this. I have the manual trying to find correct commands. The VI reads the buffer with mentioned characters. Probably you can open the VI but cannot save since LV6.0.

Let me post the VI I got.


ssalih
0 Kudos
Message 15 of 29
(2,297 Views)
Here's a 6.0 VI. All I did was strip the first 2 characters in the return string, convert to a float, and wire to the chart. No need for appending a character or converting to an array.
0 Kudos
Message 16 of 29
(2,285 Views)
The VI is working. I see the matter. Could you suggest me how to save it to a file? I send you it back with initialized values. It is still giving me the some unreadable characters. Working on. Some values come out with no numbers.

ssalih
0 Kudos
Message 17 of 29
(2,282 Views)
Do you just want to write the instrument value to a file? All on one line or in a column? For a very simple example, look at the shipping example called Write Temperature to File. It takes the measurement, adds a comma, and keeps writing to the same file. Instead of a comma, you can instead append a CR/LF to get the data in a single column. There are several other shipping examples on File I/O. You might want to try running some of them, look at the results, and determine what you want in your file.
0 Kudos
Message 18 of 29
(2,280 Views)
One think I figured out that if instrument give no data (some how), the out put show some unreadable characters.
Two problems: It takes the data into file but no “time row”, only data row, so it has to be transposed. I want to take the value and time as a two column.
Secondly it does not chart correctly. Do you think it is due to the no correct format string? The out put has to be like a,aaaaE-aa.
I send the VI back, could you check it out.

ssalih
0 Kudos
Message 19 of 29
(2,271 Views)
Well, you have no time row because you're not getting the time anyplace. You actually have to call one of the time functions. If you just want to record time and the values when the acquisition is done, look at the attached modifications. I get the current time (with seconds) with each loop. After the acquisition, I take that array, the value array and make a 1D string array. All acquisitions with time are a 2D string array that a modified Write to Spreadsheet File will write to disk. I've also attached the modified Write to Spreadsheet file. The directions on how to do yourself are on the diagram.

Your problems with sometimes not getting a reading might be that you're trying to read too fast. I'm not sure. Without hardware I can't tell. And why do you have a %13f; as a format string. What is the point of the ";"?
0 Kudos
Message 20 of 29
(2,269 Views)