06-03-2013 04:39 PM
Sorry - I missed that the error is now a non-error status update. Try using a copy of my code, with the output text concatenating until you press the STOP button, and see what you get. The code you have currently isn't waiting for data - it runs, and if it finds no data, returns no data regardless of what you feed into the Byte Count input.
Also - you don't need the Flat Sequence structure - the VISA Reference and Error cluster are enforcing dataflow.
06-03-2013 04:48 PM
It is actually back to the error code. This is what i currently have
06-03-2013 04:51 PM
Please send me your code.
06-03-2013 04:54 PM - edited 06-03-2013 04:56 PM
Here it is.
I also found example C code that uses the header VISA.h to send data to LabVIEW. Should I use this instead of just writing to UART registers?
06-03-2013 05:21 PM
Ipatka,
It's obvious you're new to LabVIEW though you also appear to be a quick learner, as although you missed a few things in my example (the shift register, and you didn't put the string concatenator in the case structure, and have only one Case in your Case statement, which you made Default to get the VI to run, but it was still trying to read even when there was nothing to read), you correctly switched from the Init Serial command to the Properties options to configure your port as per the help document. Do you get an error on the output of the configuration command? If so, try removing parameters one at a time until the error goes away, and see if you get it working.
Also, in my example, I should have showed my alternate Case of "0", with the String In tunnel connected to string out, and error in connected to error out, with a 10 ms Wait inside as well - to let the serial port start to buffer data while not burning unnecessary CPU cycles. I also didn't have a VISA Close statement, though that occurs automatically when the VI terminates. I'm attaching the example again using the Instrument Properties to configure the port. See if it works for you.
06-03-2013 05:29 PM
Thank you for your patience. This has been very helpful.
I get the error at VISA read, not at the configuration command.
Could this be an issue in the code for my uC?
06-03-2013 05:52 PM
I think I found the problem. In my C code I forgot one set of parentheses which threw off my baud rate. Now I'm getting output but it is just empty boxes. There must be some issue with formatting.
06-04-2013 08:40 AM
Is the data you're reading a string or a series of bytes? If it's not a string, you should use the "String to Byte Array" converter to get the ASCII codes for each character. I'm not sure of how familiar you are with ASCII, but most codes are non-printable characters.
06-04-2013 08:46 AM
I actually just came to that conclusion when I converted the string to a byte array and displayed it. It is displaying an array of the ASCII code for the @ symbol (64) but what is strange is that I have my C code transmitting an unsigned char 1. What format do you think I should be transmitting?
06-04-2013 08:50 AM
Do you think the byte I am transmitting could have gotten logically shifted so the 1 is in the 7th place on the bit giving a 64 ASCII?