marcelosepulvedavaldes7 Posted October 14, 2004 Report Posted October 14, 2004 Hi, Im new using Labview and I want to make a serial transmission with another computer. My Laptop dont have serial port so I buy a USB-Serial converter. I'm using this device and I cant do the connection. Anyone can help me please?!?!?! Thank you Marcelo Quote
rubo Posted October 14, 2004 Report Posted October 14, 2004 Marcelo, you might try a different brand of converter. I'm found out that some of the types of converters do not work as well as others. I used this one: <http://devicebaystuff.com/keyspan/hpserial.html> It also comes with plenty of drivers for dif applications. I'm currently working on a similar connection...if I figure something out, I'll reply again. Rubo Quote
marcelosepulvedavaldes7 Posted October 19, 2004 Author Report Posted October 19, 2004 thank you rubo i still cant do the communications between the two computers. My device is instaled on COM4 and I put the resource as ASRL4::INSTR and I also tried as COM1 but I cant receive or send anything. Somebody know where can I see a different example from the ones tha LabView have? or somebody can tell me which is the algorithm to do the communication? I really need help Thank you to all Quote
aledain Posted October 20, 2004 Report Posted October 20, 2004 The first thing to do is to check that the cable connections are correct. The intrument may require a null modem cable (where the transmit and receive pins (2,3) are reversed) or it might (rarley) do the crossover for you and require a straight through cable instead. Next check the pinout for the cable matches that for the instrument, especially if the instrument is D25 type connector, say and your PC com port is D9 type of connector. The next things to try are changing the baud rate, parity, stop bits, etc to match that specified in the instrument documentation. Then start playing with the comms handshaking. Again, this should be specified in the instrument's documentation. If your instrument still doesn't communicate perhaps you need to enable communications from within the instrument's setup menu. Note that most LV examples use simple defaults for the serial comms setups (ie 9600, 8, N , 1, with no handshaking [9600=baudrate,8=databits,N=noparity,1=stopbits]) and so need tweaking to match the instrument. Note, it is sometimes easier to play with these settings with a program such as hyperterminal until you work out the correct parameters. Alternatively try the Serial Driver from ICON Technologies Serial communications are broken up into several different types depending on the instrument. From a programmers point of view and in most cases, instruments are either a transmit receive type or a receive only type. (A third case is a full OSI model of ACK and NACK with error handling. Thankfully most instruments don't use this!) - Transmit Receive: These instruments require sending of a command, waiting some time and receiving a response. For example you might have to send FREQ?\r\n to the instrument and it would respond with 2.345HZ\r\n. - Receive Only: At intervals (either timed or in response to some stimulus at the instrument) data is spat down the serial line to the PC. For example, every second 2.345HZ\r\n arrives on the serial line. The next most important aspect is the termination character. Most instruments use the \r\n pair of characters to indicate that the transmission has ended. So in the serial reader you would specify to read until these characters are matched (and you need to set a timeout long enough for the instrument to respond). Under VISA you can specify \n as the terminating character and this will work for the majority of applications (ie those that transmit in ASCII). By now you should be seeing something in your LV program (or hyperterminal). Lastly you need to consider how the data is formatted. Many instruments communicate in ASCII (eg 2.345HZ\r\n) but others send their data as a stream of bytes (ie 00 01 02 03 04) all of which are unreadable and need to be decoded before the number can be returned. Encoding (transmit/receive type comms) and decoding information will be detailed in the intrument manual. As a last few examples, I could send the same number "5" either in ASCII (readable) form "5" or as the byte value of 05 (unreadable as in x05) and I could send the letter "A" either in ASCII form "A" or as the byte equivalent x41. Confused? Don't rule out that someone has not already written a driver for the instrument you want to talk to. Check out the FAQ for a list of places to look for instrument drivers. cheers, Alex. Quote
marcelosepulvedavaldes7 Posted October 21, 2004 Author Report Posted October 21, 2004 Thank you for the explanation. The problem is that I always get the error code -1073807202 My project consist in serial comunication between 2 computers, and I cant do that!!!! Maybe its the type of usb serial cable that Im using because when I connect the pin number 2 and 3 to transmit and receive myself the same error appears. I would try to get some other cable. PD.- Sorry for my english Quote
aledain Posted October 22, 2004 Report Posted October 22, 2004 The error code is telling you that it is NOT necessarily the cable but much more likely that VISA is not installed correctly. Warning -1073807202 occurred at an unidentified location. Possible reasons: VISA: (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded. Quote
marcelosepulvedavaldes7 Posted October 28, 2004 Author Report Posted October 28, 2004 im using the labview 7 student version and i also have the 6i version. Do you think that if i reinstall the software the problem coud be solve? Thank you Quote
aledain Posted November 1, 2004 Report Posted November 1, 2004 im using the labview 7 student version and i also have the 6i version. 2509[/snapback] Re-installing the software might work. If you haven't installed VISA into your 6i installation then it might be a matter of un-installing the VISA driver (from both 7 and 6i) and installing it again. Is the 6i version student also? I seem to remember that the student versions used to be limited (eg cannot do DAQ, cannot do active X, cannot do ..., etc). I would check with NI whether the student version allows you to do VISA comms at all. cheers, Alex. Quote
oskarbosch Posted November 8, 2004 Report Posted November 8, 2004 Also, sort of already mentioned by aledain, did you confirm that your serial port works with Hyperterminal. This is always a good first test. If that doesn't even work, then clearly you have a hardware problem. If that works, you might have to check you LV installation (and/or VISA). With LV6i, you might be able to use some serial communications that does not use VISA, but the "older" serpdrv driver. This could maybe be easier for testing purposes since you don't need VISA. With LV6i, check the vi's in the LLB: vi.lib\instr\serial.llb (note that com1 is port 0. So com4 is port 3). Hope this helps, Oskar Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.