12-05-2009 11:47 PM
jmvrd wrote:Actually, we need to device a feedback system for us to be sure that the board receives the necessary data we're sending, so i think we would still need the VISA read command, however, we'll just do it after we figured out the VISA write properly. As much as i dont want to get too hung up here, i need to figure this out first, then the revision of the program will follow, after i successful send a data to our board, then i can concentrate on revising our program
OK, if you need to do that first that's fine. However, that means updating the microC code since that code sends no responses. To make life easy you should configure the responses from the microC so they end with a carriage return character or a linefeed. This will allow you to configure the serial port in LabVIEW to terminate reads once it sees that character. This will simplify the LabVIEW code. You may want to do the same thing for the commands to the microC if they end up being more than single characters as they are now.
If you take a look at the "Advanced Serial Write and Read" example that ships with LabVIEW you will see a general idea of how you can configure the writes and reads to end with terminations. In your case you are probably not going to need to set the buffer size or the XON/XOFF. The loop that's in there would be your program's main loop. Notice how the serial port initialization occurs outside the loop so you're not always initializing the port. There are inner case structures driven by the existence of an error which are really unnecessary and can be eliminated.
12-06-2009 09:29 AM
12-06-2009 09:47 AM
12-06-2009 10:55 AM
jmvrd wrote:
let me ask you again regarding the sequence, when it is more advantageous to use the stacked sequence compare to a flat sequence? in my case, with the program that i have, is it still more advisable to stick to flat sequence rather than shifting to flat sequence? thanks
You're actually asking the wrong question. Sequence frames in LabVIEW are used to enforce execution order, so they should be looked at from the perspective of which is the best method for enforcing execution order, rather than which one is better for your program. You need to use sequence frames when you cannot use a wire to enforce execution order. Remember that LabVIEW is a dataflow language, which means a function or VI will not execute until all data on all its wired inputs is present, and that data must be generated from somewhere, whether it's a control, a constant, or a VI (including global variables). Thus, wires can be used to enforce execution order instead of sequence frames, and are the preferred method for doing so.
ok ok..will try to look at it and study it further. so far ive just focused on the basic read and write sample on labview and didnt think i will be able to use the advance serial sample their since i find it complicated and cannot understand the block diagram at all. anyway, thanks again for the help!
Well if the Basic Serial Write and Read was clear, then the Advanced one isn't that much different. The only additional things it does is:
12-06-2009 07:26 PM
12-07-2009 09:22 AM
12-07-2009 09:27 AM
If you are referring to the DTR pin of a serial port you can set this using VISA Property nodes. See the "Troubleshooting Serial Line Monitor" example that ships with LabVIEW.
If you are referring to some other line then you need some hardware to set the line high.
12-07-2009 09:37 AM
12-07-2009 09:55 AM
jmvrd wrote:
aahh..ok ok..if i set the said pin in serial port..does that mean it will be carried over to the specific DTR pin of my microcontroller? so there's no need to actually create a program to do it? thanks again.
Only if you have a physical wire connecting the pin on the computer to the pin on the microcontroller.
Sometimes you really do need physical wires.
12-09-2009 06:37 PM
Hi,
I already successfully communicated with our 8051 board and i was able to send data from labview to our micro. Thanks for all the help! Greatly aprreciate it.
Btw, how can i change the picture(array) set at the strumming VI? im planning to change and modify the said pictures (the one with arrows, and arrows lighted up and down). thanks again.