Jump to content

orko

Members
  • Posts

    576
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by orko

  1. If I understand correctly, how about an array or cluster of LED controls? 1 = ON = Illuminated, 0 = OFF = dark?

    That's what I'm after, essentially. I was hoping someone with more artistic talent than me had made one that had good picture overlays of the zeros and ones. Or perhaps had already solved the whole "auto-tabbing through an array" while someone is typing one bit at a time?

    Or are you looking for text entry? Could use a string control and then parse it into bits.

    Nope. No text. Just binary. I know I could use a numeric control, but would prefer a more "graphical" one, like the boolean array discussed above.

    Thanks for your input! I'm thinking more now that I'll have to work these up myself, but if anyone has seen an example like this using boolean or picture ring controls, please let me know. :unsure:

    Joe (orko)

  2. Actually the echo happens whithout any cable being present on the Comm Port. This is why users think that the cable connection is fine and everything while in-fact they are not even connected. I can find a way to filter the polling characters, but if I can turn echo off then I would go for that

    :blink: I must not understand your setup correctly. Are you saying that you have LabView running on a PC, writing to the COM port, with no device connected? And you're getting echoes? Where's that Holloween "spooky" emoticon....

    Anyway, if you are indeed in the above setup, then I would think it was your program, not your COM port that is creating this anomaly. Would you mind posting or emailing it to me?

    Joe (orko)

  3. yea, just take a big hammer and bash it on the device, i am sure this will turn the echo off immediatey ;-)

    ...that didn't work on the last co-worker I had...

    Anyway, make sure that the serial cable is unplugged before attempting this "percussive maintenance" fix. :D

    Joe (orko)

  4. Hello all,

    I've been tasked to write up some VIs that are communicating to an old microcontroller in a unit through GPIO (this really doesn't matter, but I thought I'd give you an idea of how old the stuff is I'm dealing with :rolleyes: ). The old program is written in Turbo Pascal ( :blink: )

    Anyway, it will be a pleasure to port these over to LabView. I'm wondering, since my old UI used binary 1's and 0's to allow the user to communicate/program registers, is there a set of old school controls somewhere that have been built that make it convenient?

    Like:

    Addr: 0|0|1|0|0|1|0|0

    Value: 1|0|1|0|1|0|1|0

    And an "enter" button to press when you have the right values in them. A plus would be if the control "auto-tabbed" through the bits while you were typing. In other words, clicking on the first bit in Addr and typing "00100100" would fill in the booleans appropriately without having to tab or click again on each bit.

    Any thoughts/pointers? I'll start mixing up my own if no one can find their keys to the "OMG that's old" locker.

    Joe (orko)

  5. Is there a way to hold back a Serial COM Port from echoing back characters written to it? Can this be done from within LabVIEW?

    I have this LabVIEW application which must poll a COM Port to get back data. However, the polling characters get echoed back giving the impression that the other system is talking back --while in-fact this is not the case.

    Anthony,

    In my experiences the echoing either comes from the application sending the command (local echo) or from the *device* that is connected to the serial port. LabView (the programmer) has control over whether or not the commands are echoed back to the user on the display, but unless there's some sort of command you can send to your device that it understands, LabView has no control over turning a device's echo off. Since you were talking of a false response from the device, I'm assuming that your echo is coming from there.

    What kind of device are you talking to through the serial port? Perhaps there's a way to turn its echo off? :unsure:

    Joe (orko)

  6. You're very welcome. I hope that you will in the future help contribute to this awesome board! :)

    BTW, there are two things you may want to fix in your final.vi.

    1) place VISA Close objects on the outputs of the while loop. You can keep the two indicators if you want them, but closing the VISA sessions prevents possible problems in the future (especially if you make a VI into a subVI or make it reentrant).

    2) By the looks of it, you're still sending an empty string to the VISA Write object every 50 msec when the program is idle (when no button is pressed).

    Good luck with your project!

    Joe (orko)

  7. What I did once in an application was using the enclosed VI. Use the alias array to initialize the strings of a Ring Control. Then use the selection of the Ring Control to index into the adress string array and pass this to the VISA Open.

    Rolf Kalbermatter

    Thanks Rolf! I didn't think to use both the canonical and the alias names in the indexed array. :D

    Nicely simplified example!

    Joe (orko)

  8. Is it just coincidence that you and "zero-tolerance" appear to be programming for the same hardware & same user interface or are you posting to this forum under two names? :nono:

    You caught that too, eh Warren? :shifty:

    Anyway, if all you're trying to do is clear the indicator, there's two ways that are usually used. One is to use a select or case statement to decide between filling the indicator with the string received (from the hardware) or an empty string. The other is to use an invoke node (right click indicator; Create->Invoke Node) and chosing "Reinit to Default" to set the indicator to the saved default state.

    I'm kind of unsure however why you would need to clear this particular indicator since you are directly writing to it (not concatenating) and only reading the bytes available on the port. Do you want to eliminate the scroll, or "Reset" the messages in the indicator to an empty string...?

    BTW, I noticed that you are sending an empty string to your motor every 50 msec when no button is pressed (idle state). Don't you want to instead put your VISA Write inside the case where the button is pressed and place the wait outside in the main loop?

    Joe (orko)

  9. I have a VI that is executing a case structure and within it are twe events in the same structure where event 2 requires event 1 as an input. I have put event 1 right above event 2 but the program is picking event 2 before event one and hence confusing the process. Is there a way I can condition the VI that event 1 has to be perfomed first before event 2 in the same case? Thanks

    I agree that there isn't quite enough info in your post about how your program is structured, but what it appears you're after is a state machine. I've attached a simple example just in case it will help you out.

    Download File:post-3266-1140491062.vi

    Joe (orko)

  10. Thanx for that "orko" but for some reason when I connect your program with the WMassey program that gave me it doesn't work properly. Everytime I run it it keeps sending the command over and over again even though I dont press the "Send" button, but when I press the "send" button it sends several commands straight away, where I only need it to send 1 command per click.

    Sorry about that. I was hoping to eliminate occurances or using an event structure, which I normally do but wasn't sure if you had any knowledge of yet. That'll teach me for trying to skip steps ;)

    With WMassey's package and the vi's that have been given to you, I think you should have enough to get the job done. If not, please look at event structures and/or occurances to make my example work a little better. Sorry I don't have time right now to put together an example for you, but will later in the week if you need it.

    Good luck!

    Joe (orko)

  11. Thanks for the clarification. What it looks like you needed then was an example of how to format a string conditionally based on the user input, so you get the correctly formatted command out to the motor. The attached example uses a "ring" to select which motor you want, and calculates and formats the string before storing it into a string.

    Let me know if this is enough to get you going and if any of this doesn't make sense to you. It looks like putting this together with the logic that WMassey gave you should get you the desired results, with a little tweaking. You should be able to take it from here :D

    Download File:post-3266-1140387314.vi

    Joe (orko)

  12. I managed to do the 1st point above somehow, even through its not exacly what i needed, but I really am scared about the third point, I have no idea how to even start with that. Could anyone please help me out a little. thats the hardest part that I am facing so far.

    Zero,

    I'm afraid that is way too vague for me to try and answer. What is your specific question? The third step in your procedure you outlined looked like pure math, so I'm confused about what it is you want help with?

    Joe (orko)

  13. That's an interesting idea concerning the missed data. That may be what's happening.

    While I pull together the other information you asked for, could you explain how I can make a queue to store the intermediate data?

    Thanks!

    -Steve

    Here's an example. It may need some refinement, but it explains the idea behind "producer/consumer" loops. The consumer loop is where the work gets done.

    Notice that even if the consumer loop takes a long time to process, the producer loop continues to gather data and store it in the queue.

    Download File:post-3266-1140219841.vi

    Hope this helps. I think there are some examples in the help under the keywords of "queues" and "serial" if you need more explanation.

    Joe (orko)

  14. sorry, i have a stupid question, please give me an intelligent answer ;-)

    what is ECM?

    ... google finds to many results, e.g.:

    - Espresso Coffee Machines

    - Enterprise Content Management

    - blablabla

    I'm glad you asked for an intelligent answer, or I would have posted a list like:

    Electret condenser microphone

    Electro chemical machining

    Electronic countermeasures

    Electronic contract manufacturing

    Electronic control module

    Elliptic curve method

    Error correction mode

    Extracellular matrix

    Easter candy monster

    East coast madness

    Everybody craves M&Ms

    Eeeeehaaaw, Country Mama!!

    </Crazy Mood>

    :yes::blink::yes:

    Joe (orko)

  15. sometimes you get just crap over RS232, so i would put a case structure around the knob, connect the scan from string error out to the case selector and make it the no error case.

    If you dont connect the error out at scan from string nodes, you will get these nasty error-popoups, if the scan fails, which you maybe don't want to see, because it's "normal" that sometimes the scan from string fails ...

    Thanks for the reminder, i2dx. Error handling is always the fun part :)

  16. Can you provide an example VI? It would help if you save it for LV 7.1 so more people could look at it (I'm hoping to upgrade to 8.0 next month). ;)

    What are your settings for the serial connection set at? You probably already verified that your port settings are set exactly to what your instrument specifies, although sometimes it is a matter of tweaking the timeout value, if it is set too low (I think it defaults to 10 seconds though). Are there any errors set when the incomplete reads happen?

    Another thing to look at is if your data reads are being slowed down by other logic in your VI. It may help to stream incoming data into a queue in one while loop, and perform operations out of the queue in another. Since you have no flow control lines, you may be running into a condition where you miss data when your logic takes more than 500 msec to run.

    Joe (orko)

  17. Hi,

    My labview program is communicating with a microcontroller that is sending me a message "The angle is: 255 degrees". I am trying to get labview to take the value of the angle and turn the knob on my user interface to 255 degrees. I was wondering if anyone knew how to get labview to distinguish the number from the string of characters coming through the serial port and turn the knob to the appropriate position.

    Thankyou.

    Attached a quick example using "Scan From String" in the String Function Palette:

    Download File:post-3266-1140131641.vi

    Joe (orko)

  18. In the vi.lib folder, put a VI named lv_init.vi. This VI is called at LabVIEW launch. You can use this VI to launch other executables or any other task.

    That's slick! :thumbup:

    The only reference that I've found to this is an article in Google's cache from Jim Kring (kudos!) coming from the OpenG tiki (which is currently down probably due to their recent upgrade). There are a lot more of these event callback VI's listed, here's a copy out of the cache (in rtf):

    Download File:post-3266-1140129786.rtf

    • Like 1
  19. Q1: do you know how to generate new occurrences each time a vi runs?

    Q2: do you know how to "clear" an occurrence?

    thanks. michael.

    PS i've attached a simplified version of the vis, but the llb still contains 84 or so vis.

    Each time a generate occurance instance is called, it generates the same occurance (almost like a constant). You can create more than one occurance value only by placing another generate occurance on your diagram. From the online help (LV 7.1.1):

    ************************************************************************

    Generate Occurrence Details

    Ordinarily, only one Generate Occurrence node is wired to any set of Wait on Occurrence and Set Occurrence functions. You can wire a Generate Occurrence function to any number of Wait on Occurrence and Set Occurrence functions. You do not have to have the same number of Wait on Occurrence and Set Occurrence functions.

    Unlike other Synchronization VIs, each Generate Occurrence function on a block diagram represents a single, unique occurrence. In this way, the Generate Occurrence function is similar to a constant. When a VI is running, every time a Generate Occurrence function executes, the node produces the same value. For example, if you place a Generate Occurrence function inside of a loop, the value produced by Generate Occurrence is the same for every iteration of the loop. If you place a Generate Occurrence function on the block diagram of a reentrant VI, Generate Occurrence produces a different value for each caller.

    Note National Instruments encourages you to use the Notifier Operations functions in place of occurrences for most operations.

    ************************************************************************

    Notice the note. I think you may want to look at using the notifier operations for your purpose.

    HTH,

    Joe (orko)

  20. Have you comfirmed the VISA resource name in MAX and timeout value? WMassey's VI ran perfect out of my serial port with the proper VISA resource name, although it did take 10 seconds (for the timeout to kick in).

    I also was wondering if you tried to communicate with the device from MAX (Measurement & Automation eXplorer).

    Joe (orko)

  21. I recently posted a LV 8.0 VI on another board, it was just a bundle by name example. Problem was they needed it in 7.1, so I did a save to previous version and reposted the VI. When reading over the thread I noticed the 8.0 VI was about 13 k and the 7.1 was about 23k. Anybody no why, just curious?

    From page 83 of the upgrade notes: http://www.ni.com/pdf/manuals/371780a.pdf

    *****************************

    File Size Improvements

    Saving VIs from earlier versions of LabVIEW in LabVIEW 8.0

    significantly decreases their file size. The file size of VIs you save in

    LabVIEW 8.0 is about 55% less than the file size of the same VIs in

    LabVIEW 7.1. The file size of LLBs in LabVIEW 8.0 is about 20% less

    than the file size of the same LLBs in LabVIEW 7.1.

    *****************************

    Pretty cool stuff :D

    Joe (orko)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.