LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a normal number to binary?

At some point, you really, really, need to approach your management about upgrading your version of LabVIEW to the full version. It won't be very practical to keep asking members on the forum to update your VI when you need to modify the event structure. If you can't get an upgrade, the best thing would be to rewrite the VI and eliminate the event structure. I personally think the event structure alone is worth the cost of the full version of LabVIEW but many programs have been written without it.
Message 121 of 129
(1,850 Views)

A couple of things:

1. Do you really think that given the chance I would turn down the chance upgrade to the full version, have a service contract, and stay current with every new upgraded version? I wouldn't.

2. Do you think that I like having to write these hideously complex VI's with no real LV training whatsoever? I don't. I hate being in this position of filling some LV programmers shoes just because im the only one smart enough o figure out how to do it.

The first VI I provided had all sorts of buttons I was trying to connect with wires. That is the extent of my knowledge. I Didn't know what an event structure was, or how to use it, and I didn't know it was not in the base package, and that it would be so troublesome to work with. I very much appreciate you guys helping me out, but now im left with a VI that doesn't work, and now I am not capable of fixing it.

Dennis, Im not sure what happened when you graciously fixed the VI for the last time, but now It does not work anymore. I am unable to press the speed, estop, or stop buttons and the VI locks up after the second read function, (after I send the ACK 06). 

I would like to eliminate the very cool, but unworkable-for-me event structure. It is just way over my head.

I think that the work that you people have done for me is spectacular. The scope of LV knowledege that is available thru this discussion board is amazing. To be honest LV really interests me. I like using it. However I do wonder how users such as Dennis become so knowledgeable about it. Have you gone to all the LV classes? Or are you learning it all from books or actual experience?

I would love to work for a large company that has the resources available to keep me up to date with all the LV updates, and I would love to go to all the training seminars. As it stands right now I haven't seen a raise in 2 years, and im stuck swapping hardware around from machine to machine to get the testing done. Some things are just beyond my control.

If there are some fantastic 3rd party LV books out there, I would certainly just go out and buy them for myself. Please let me know if anything like that exists.  

 

 

 

Message Edited by Vr6Fidelity on 08-06-2007 08:32 AM

0 Kudos
Message 122 of 129
(1,815 Views)
Hello vr6
 
you sound pretty sad...
to make you feel better: i think a lot of lv users are self-taught. lv has this amazing compiler, which point so clearly to every error, and allow very easy experimentation with different fonctionalities. on top of that, every thing can be done in numerous ways, even if not totally efficient. in other words, you can try, now that you have much better knowledge of your program requirements (thanks to all gurus up there), to rebuild from scratch your software solution. do it step by step, small piece by peace, that you can control and test separately. once you have that, mounting everyting together must be simple.
if you dont have event structures, forget about them. most of lv typical users dont know about it: most people  use LV but rather casually to fill and answer the problem of the moment. personnally, i do not know of a single student or university staff who knows about it. it is the same for a lot of functionnalities of LV. so, just with what you have, you can already make some pretty amazing programs.
 
i disrecommand almost all the books for LV. 3reasons:
1) it is generally faster to experiment yourself!
2) lots of examples in the help and online
3) generally the books are badly written -virtually all the books i got my hand on were extremely disapointing.
except one: The Labview style book (Peter Blume i think). this one doesnt concentrate on what you can do with LV, but how is the best way to do it. and it is very nicely presented. you'll find there examples which does not use any of the extended or proffessional package, still manage to get same functionality.
 
and dont forget: LV isnt only about getting the best, but having the most fun doing it Smiley Happy
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 123 of 129
(1,798 Views)

I think the last VI you got was from Ravens Fan but if it's broken now, you should attach your latest.

In order to eliminate the event structure, you have to use a polling technique. There are a couple shipping examples that show how to do this. One is called Old Event Handler. This uses an architecture called a state machine. You can compare this example to the one called New Event Handler. You don't have to use a state machine though. A while loop with your different front panel Booleans wired to case statements might be good enough.

I can sympathize with your situation. I was stuck with LabVIEW 7.1 for years and the only reason I was able to use that is because a department was closed down and I inherited the license. After years of begging, I came under new management and she was finally able to get me up-to-date and on support again. You just need to keep management aware of your needs and not give up. In the mean time, study the shipping examples and look through the example code on the Developer Zone. Also, log into the forum on a regular basis and look at other questions and answers - not just your own. I'm going through some old posts myself, to try to get up to speed on new 8.x features such as Xnodes and object oriented LabVIEW.

I can't really recomend any of the current books since I haven't purchased any of them. I had one of Gary Johnson's advanced LabVIEW books and thought it was excellent. Gary has been using LabVIEW since version 1.0. The book LabVIEW for Everyone is by Jeffrey Travis and Jim Kring. Jeffrey wrote an earlier book on Internet applications that I used and Jim Kring is regular contributor to this forum (and to OpenG).

0 Kudos
Message 124 of 129
(1,789 Views)

Good morning Dennis. I hope you had a fabulous weekend.

Here is The Vi as it sits now. Im not sure how much sucess you will have running it, I know It returns NAN for all values on my office computer with no card, and since the code itself is depentant on answers from the controller, that dosen't really work well either.

Right now im trying to figure out why i have one more column of data than i do column headers! But I can handle those minor issues.

What I cannot comprehend is why some of the buttons cannot be pressed when the VI is running, which is not safe for humans around this ultra high speed experimental equipment.

 

 

 

0 Kudos
Message 125 of 129
(1,774 Views)


@Vr6Fidelity wrote:
What I cannot comprehend is why some of the buttons cannot be pressed when the VI is running, ...

You need to learn to be much more specific when reporting problems. Which buttons can be operated? Which cannot?

One possible problems is that your event structure is configured to lock the front panel until it completes. If e.g. your VISA stuff has a long timeout, your FP locks for a long time. I thought you're going to eliminate the event structure?

0 Kudos
Message 126 of 129
(1,764 Views)
At some point, you moved the free floating text that describes the buttons to be on top of the buttons. When you did that, you can't click on the buttons underneath the text. Try the attached VI. I cleaned up the DAQ stuff the best I could but you need to work on eliminating the event structure.

Message Edited by Dennis Knutson on 08-06-2007 10:48 AM

0 Kudos
Message 127 of 129
(1,753 Views)

Ok Dennis I have moved onto my next LV task. But I am trying to improve my skills so this time I want to use the nifty for loop.

So in this super code you have given me, you have a for loop. So i read the help for the for loop and it talks of the N terminal for the number of iterations (channels in this instance). So to measure 6 channels I would wire 6 to the N terminal.

Here is where I get confused:

You have nothing wired to the N terminal. How does your for loop know what to do?

Also, You are not using index array at all. Instead you are using "convert from dynamic Data" which has a much longer and more complicated help file. Im not quite "getting it". I recently realized its a sub-VI, and I clicked on it. You have 1-D array of waveform selected. From my limited LV knowledge, I would imagine this would be an array consisting of ONE value from each scanned virtual channel coming out of the DAQ assistant. But then If this is true, I dont understand the use of "Get Waveform Components" from what I understand takes a waveform (a data type I dont quite understand) and breaks it into an array of y components at some unknown-to-me interval. Then The mean does its thing. I understand the mean at least!

So could you explain the functionality of the convert to dynamic data, and get waveform components combination? Why would you use these and NOT index array.

What would be the advantage of doing that vs a for loop with an index array instead?

I am interested in improving my coding skills, And most of my code seems to be almost offensive to you, so im anxious to improve.

Sincerely,

Grasshopper.

 

 

 

  

 

 

 

0 Kudos
Message 128 of 129
(1,672 Views)
The For loop as an auto indexing tunnel going into it.  It looks like a [ ].  That is like a For Each Next loop in visual basic.  (i.e. for each object in collection).  So the loop knows how many times to run based on the number of elements in the array, and you don't need to explicitly wire the N node of the for loop.
 
Going into the express VI is a dynamic data which is a collection of several waveforms.  (Not sure if there is a better term for this.)  The express VI converts these into a 1-D array of waveforms.  That 1-D array gets autoindexed at the For loop.  So the loop acts on one waveform at a time.  A waveform is actually a cluster of several items, this includes a T0 timestamp value, and an array of Y values which are the array of points that make up the waveform.
 
Inside the loop, the Y array gets plucked out of the waveform cluster.  That array goes into a VI to calculate the Mean of the array.  On the righthand side of the For loop, the Means get autoindexed which means an array gets built back up from the means that are calculated out of each waveform.
0 Kudos
Message 129 of 129
(1,667 Views)