03-13-2009 02:51 PM
03-13-2009 03:11 PM
If you review my Nugget on Action Engines you will find that SR is an abreviation for Shift Register.
Ben
03-13-2009 03:59 PM
apparently I am trying to pass a variable by accessing its name but the name would change with each loop.
I can see people are trying to be helpful, I think it is just one of those things not possible in this programming language. In other languages, one would concatenate the
"base name" with the loop integer and it would be recognized as the variable name, changing on each pass.
I would like to thanks those who tried to help and withdraw my question.
03-13-2009 04:38 PM - edited 03-13-2009 04:40 PM
You can create an array of references then write to them by property node. It's a little bit of work on the front end to create the references and build the array. But once you have it, you have the array wire you can carry around.

03-13-2009 06:39 PM
Example from ASP.NET
dim var1
dim var2
dim var3
for i = 1 to 7
var3 = var2 & i
process each time.
loop
Many other examples exist for other text-based programming languages.
03-13-2009 08:19 PM
I don't know if I'd consider ASP a real language. I always thought it was some Microsoft web based hack.
Can it be done in VB or C++?
03-14-2009 09:29 AM - edited 03-14-2009 09:38 AM
HI Wild,
Thank you very much for the text based code.
I came from a texy text based background but never did ASP but I think I can guess at a transliteration* that may help but first notes.
1) LabVIEW handles all memory operation for us so we don't have to declare variable names. In LV we think wires instead of memory locations. Once you get used to that idea I hope that you will not miss having to declare variables.
2) SInce LV is graphical the structure differs from text. Instead code being structured from the top of that page to the bottom it is structured from the "root" (blank white space the diagram is built on) then into nested structure. ( The learning curve will be steeper if you come from a macro background where you have to turn your mental model inside out or upside down! Again, once you get used to it it makes it easier to apply to real world situations. It is like the difference between steering a boat with a rudder vs a steering wheel. You have to react differently to achieve the same result.)
Please code up this VI and watch it execute in Execution Highlighting mode (turn on the light bulb and watch it slow motion).
Note:
This code is a "verbose" version of the code I posted early in this thread. I re-wrote it so you could see each of the operations.
If you run into more Qs about coding in LV don't hesititate to post up.
Ben
* I use the term loosly.
03-18-2009 03:33 PM
This looks more like what I had in mind. I think I could suss it out if I had a LabView 8.0 - readable version of your example asp.vi . Is that possible?
I knew I could concatenate strings but the trick is using that string to call the appropriate variable.
Thanks.
03-18-2009 03:41 PM
Code as much as you can then post your code when you get stuck.
Most of the cotributors to thsi forum will be albe to help with any trouble you may have duplicating that code.
Ben
03-18-2009 03:43 PM
so it's not possible, I guess that is going to severly limit the usefulness of this forum to users of older versions.