10-30-2015 02:23 PM
Yes. You now have the termination character set to carriage return.
I would probably change the byte count control to a constant and make it 1024 or larger. That way someone cannot accidentially set it to a small value and cause problems. Setting to to a larger value (like 2000) does not cause any difficulties. The VISA Read terminates when the termination character is received or when byte count characters are received, whichever comes first.
Lynn
10-30-2015 02:42 PM
Again, I agree with Lynn -- wire a constant (1024? 2000?) to your VISA Read, run your program, and tell us what happens. I recommend putting an indicator on "Bytes Read", as this (along with the contents of the String) would be "clues" to what is happening.
What can you tell us about the instrument that is generating the Serial data? Is there a manual for it on the Web? If so, we could look at it and maybe determine (because they tell us) if there is a Termination character, and if so, what it is. Who knows, they may use some other protocol (I've certainly got a serial instrument that "does weird things" and needs special programming to get the data in).
Bob Schor
10-31-2015 10:50 AM - edited 10-31-2015 11:12 AM
Hello,
i have done as you said but still not working. And when i select the wrong port still the program is running( i dont know why) and if i select the correct port its running but not accquiring any data from putty, still it shows nothing on string read. sometimes it running but the data in putty is different from data in labview( i dont know from where it getting this false data) . if it is running, its not accquring data properly (eg: it counts as 54,53,54,55,53,53......very fastly to and fro,even serial data is in seconds) . This are the problems i am facing now. Please help to solve this problems.
Thank you
10-31-2015 12:53 PM
This is very frustrating -- you are having difficulty, we ask questions that you don't answer, and neither you nor we are any closer to understanding the difficulty you are having.
It appears (to me) that you are attempting to read serial data from some Unknown Device. You seem to be able to read data using PuTTY (but haven't told us how you configured PuTTY, nor what the data looked like), you've never heard of (nor tried) MAX, and when you use LabVIEW to do serial reads, it "doesn't work" (but, again, you don't exactly tell us what it does do).
Here are some very specific questions.
To summarize, tell us more about the device generating the Serial Data, tell us more about What Works, and try to exactly duplicate What Works, first with MAX and then with LabVIEW and VISA. If you give us some data to go on, we can do a much better job of suggesting something that should work.
Bob Schor
10-31-2015 03:55 PM
I agree with Bob - and his frustration.
If you want help, please make it easier for us to help you.
In addition to all the things Bob asked, please do one more thing. Run your VI until you get "something" returned. Stop the VI. From the Edit Menu select "Make Current Values Default" and save the VI with a new name. Then post that VI. It will contain some of your data which may give us a clue.
Bob: Item 4: Simply install on any non-Windows platfrom and you will not get MAX.
Lynn
10-31-2015 04:41 PM
Lynn -- as you may have guessed, my only real experience with LabVIEW has been on the Windows platform! My bad ...
BS
11-03-2015 05:13 AM
Hello,
Sorry for the trouble. And many Thanks for Your patience.
Note: If i try to read on Basic read VI, I am able to read the data correctly (almost, sometimes single digit numbers are appearing in between the counts, while reading larger data). And when i connect the While loop, Waveform and write to spread sheet, then it's not working at all.
Thank you
11-03-2015 05:23 AM
Hello Bob,
I have attaching the Vi as u asked. When i count seconds, it is repeating from 294 to 299 and the spreadsheet looks like the attached file.
Thank you
11-03-2015 10:23 AM
Thanks. I wrote a very simple Serial Test -- it reads 100 times, saving the data in an array (for viewing), and times how long it takes. Here is the code:
Before you run it, make sure that the COM port going into the VISA Configure function is appropriate for your system (click the down arrow and choose the Port to which your PSoC is connected).
When you run this, it should read 100 times from your PSoC. I also have two timers to allow me to compute the number of Reads per second.
Please run this on your system, and post the results.
The figure above is a LabVIEW Snippet (you can recognize it because of the extra elements in the upper corners). If you drag it to a LabVIEW 2014 (or 2015) Block Diagram, it should become LabVIEW Code. I am also attaching the Project from which it comes, and the VI itself. I recommend you create a folder (PSoC?), drag both the Project file and the Serial Test VI into it, then double-click the Project. If you don't (yet) know about LabVIEW Project, you should learn ...
Bob Schor