01-09-2006 09:44 AM
01-10-2006 08:17 AM
01-11-2006 04:21 AM - edited 01-11-2006 04:21 AM
As I told you in my last post, you should verify your serial port. Since you have a loop back, try something like this :

Message Edité par chilly charly le 01-11-2006 11:21 AM
01-11-2006 07:45 AM
01-11-2006 08:38 AM - edited 01-11-2006 08:38 AM
You need to make some modifications. The initialize serial port and the VISA Close should be outside the while loop. There's no reason to do either every time. I modified your example and increased the baud rate and decreased the number of samples being sent. That seems to work without an unreasonable timeout value for both the read and write.
What is the while point of this exercise? Is it just eventually to transfer data to another pc? If that's the case, you can use any baud rate you want since I presume you would be writing the program for the other pc as well. Also, using datasocket or TCP/IP to transfer data would be a much faster method.
Message Edited by Dennis Knutson on 01-11-2006 07:40 AM
01-11-2006 01:14 PM
01-11-2006 01:32 PM - edited 01-11-2006 01:32 PM
Message Edited by Dennis Knutson on 01-11-2006 12:36 PM
01-12-2006 01:57 PM
Dennis,
I re-ran your program attempting your notes, and he works so so (make hard test, change the frequency to 1Hz ang go on). Other question, in your property node you select bytes at port and the reads at the output is never greater than 4096 (512 samples = 4096 / 8 (1byte)), and I belive that the error in the frequency indicator is about it, maintain dt=0,001 sampling rate=1000 and number of samples > 512, and your signal will be looked on inner loop, see it wirh HighLight Execution. So, How can I change this number (4096) on property node?!
I´m using RS-232 for educational objectives, learning how LV interacts with it. And your idea about network cards is good, the program run very slow!
Thanxs
01-12-2006 02:22 PM
If you're trying to generate a 1Hz sine wave, then 100 samples is not enough for a complete sine wave and the frequency cannot be determined. You can increase the number of samples but when you do that, you run the risk of exceeding the serial port buffer. You can increase this by putting a VISA Set I/O Buffer Size right after the initialize serial port. I changed the buffer to 8192, frequency to 1 and number of samples to 1000. Ran it and the frequency measurement was correct. Just remember that the bigger the number of samples, the bigger the buffer that's required and the longer it will take to read and write. There is some max size of the buffer I'm sure, but offhand, I'm not sure what it is. My recomendation would be to limit the frequency to something higher that doesn't require a lot of time to read and write a large number of samples.
01-18-2006 12:39 PM - edited 01-18-2006 12:39 PM
Message Edited by 8144-9199 on 01-18-2006 12:43 PM