10-09-2013 03:02 PM
Jeez, that was silly. I'm still have a read timeout error occur, and the voltage isn't being ramped on my actual instrument. The program seems to not be telling my instrument to give a sine wave voltage output. It's only setting the instrument at 15 V instead of oscillating the voltage in a sine pattern. I just really need this VI to work, then I can take the tutorials.
10-09-2013 03:15 PM
When you add the 15v it needs to be a single scaler numeric constant rather than an array. The array you added only contains one element so your output is also just the one number.
If you put a graph indicator on your numeric data you will see what signal you are sending. Adding extra indicators to your code at the development stage can be a big help in solving codeing problems, you should also check out using the Probes.
10-09-2013 03:28 PM
I reeeally appreciate your comments, however I still have a VISA Read timeout. And when I run my VI, nothing shows up on the waveform chart. This may drive me up the wall.
10-09-2013 03:39 PM
You're taking an array of data, turning it into a string, and basically making a very long string of commands to throw at the instrument.
Is it possible you are overwhelming the input buffer of the instrument?
Also, a lot of times instruments require some sort of termination character when you send it a command such as a line feed and/or carriage return. I don't see that in any of the commands you are creating.
I suggest reading the manual for the instrument and start working with some basic simple, single commands and get that working before you start building up into larger things like working with arrays of commands.
10-09-2013 03:42 PM - edited 10-09-2013 03:44 PM
I should have said a simple scalar, rather than 'single'. Here's what it should look like:
10-09-2013 03:46 PM
You have not followed the suggestions which have been made. You can add a scalar to an array. The result is that the scalar is added to every element of the array. What you did was to add a one-element array (with value 15) to the sine array. The result is a one element array. When two arrays of different lengths the result is the length of the shorter input array.
This is what you have: (Note that the constant below the x+y indicator is a constant with teh same values as the indicator.)
Here is the way to add a scalar to an array.
Lynn
10-11-2013 09:30 AM
Thanks Lynn, my problem now is whenever I try to wire a constant to the y portion of the add function, it automatically makes it a 1D array, and I'm not sure how to add a scalar. I'm looking through the LabVIEW book now to figure it out, but not finding much...
10-11-2013 09:32 AM
Pull a constant from the numeric palette first, then connect it to the + function.
Cameron
10-11-2013 09:57 AM - edited 10-11-2013 09:58 AM
I'm still getting an error message, but now it's a different one. It says there's a problem at the VISA Configure Serial Port, but I know I have all of the correct parameters for my instrument. In fact, now the sine function is ramping, but only from 15 V to 15.4 V, then I get this error message and the VI stops. My 15 V constant on the Add function is not the same data type as the array, maybe that is the issue. I know the serial port is configured correctly. Maybe it would help if I put a Bytes At Port on my VISA Read function? I've heard some programmers say this is correct, and some say that it creates more problems than it solves. The error message and VI are attached.
10-11-2013 10:57 AM
You can't add a number to a string, which you do in two places. You have to convert the number to a string and concatenate the two strings.
Cameron