02-05-2007 01:45 PM
02-06-2007 06:30 PM
02-06-2007 08:31 PM
I then put a small delay in my loop where I read and write the ack command (hex "06"), but it gave me an instant error 1073807339 for timeout rather than occurring after I read one line of data, which usually happens." ==> This falls in line with (1). The readback in the 2nd loop worked for the last write command and after that 0 bytes are at the port. It would be interesting of what is read there. Is it corresponded to the last write command or whichever one that is written?
They seemed to be contradictory so I am assuming that you are missing some info from the developer which is after EACH write then readback and if there is any byte then write back with "/6" for ACK, then continue on with the next write and read back until "END" is detected. The reason behind this logic is that the serial port protocol usually works for one on one communication. It did not make a whole lot of sense when having to write a bunch of commands then read back only ONCE.
If you confirm this assumption is true then try the attached vi (modified):smileyhappy:.
This took me more than 1 hour of work including the re-type but I am glad to help anyway.
02-07-2007 12:23 AM
02-08-2007 07:33 AM
Adam,
Nothing had changed, that's why I was so frustrated with the errors I was receiving. However, I have a theory to which I believe why my program/executable is working now. Of course the original executable worked on the computer that I created the original vi on...but what's the point of an executable on a computer that has LabVIEW fully installed. So I saved the executable to another computer which had LabVIEW RunTime Engine 7.1 on it and VISA 3.3.1. The executable would work, but it was hit or miss. Sometimes it would work perfectly, sometimes it wouldn't work at all. I then thought that maybe it wasn't able to write/read quick enough, the computer was very old and had a very slow processor. I installed the RunTime Engine and updated the VISA drivers on to my office computer and the executable has yet to fail on me. I think this may have something to do with my processor speed. The ACK response must be sent to the spectrophotometer in under 8 seconds, perhaps it wasn't getting there fast enough on the other computers.
Napview,
I took a look at your vi and it does work . For the time being though, I'm not having any problems. If something should happen to come up in the future, I'll be sure to incorporate the ways behind your vi into my vi.
Thanks for the help!
02-08-2007 01:09 PM
02-08-2007 02:11 PM
For some reason whenever I try to open your vi now it redirects me to the LabVIEW welcome screen..
Oh well, a new problem and idea have arisen.
I have discovered a way to always have my scan complete. By simply inputting several ack commands after my scan command into the array I am guaranteed to have my scan finish. However, I get 0 bytes at the serial port, and when I have a hard setting of 100 bytes to read, I timeout. I know the solution to my problem may not in fact be a clear cut solution, but I'm taking what I can get at this moment...which is a complete scan, just nothing being read.
Thanks for any help,