LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call same block N number of times in LAVIEW

Hi ALL, I have one block which will convert string to hex. I am passing string input to this block in back end not from front end. So how can i pass different strings to this block for N number of times. Since the picture i cant able to connect second string to "E199". Can you kindly check and let us know how to pass it. And also i want know how it works one by one. means first i need to convert "F1A5" then "E199" and so on. And also let me know how to call blocks like functions in C so that i can call that block whenever i want. Since i am new to labview , i facing lot of issues. Kindly let me know how to solve this. Regards Punith
0 Kudos
Message 1 of 29
(3,294 Views)

It would be so much easier (not to mention "possible") if you posted the VI or "block" to which you refer.  Post your code, we'll look at it, and make suggestions based on your code rather than our "best guess" as to what you are talking about.

 

Bob Schor

0 Kudos
Message 2 of 29
(3,280 Views)

I have no idea what you mean by "back end"?  Data inherently flows from right to left in pretty much every built-in VI (although you could make your own backwards VI).  

 

Sounds like what you want is a for loop.  BUT, all your questions indicate that you haven't bothered to take the basic LabVIEW tutorials.  There's no point in us explaining such simple concepts when NI offers SO much free training.

 

http://www.ni.com/academic/students/learn-labview/

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 29
(3,279 Views)

Here i attached my vi code.

0 Kudos
Message 4 of 29
(3,270 Views)
I don't know what you mean by front end/back end. You have not shown any code. If you have an array of strings, you simply place your subVI inside a for loop and pass the array into it.

Calling c code usually means creating a dll and using the Call Library Function Node.
0 Kudos
Message 5 of 29
(3,266 Views)

Can you please look at my string2hex.vi and tell me how to solve this.

0 Kudos
Message 6 of 29
(3,258 Views)

Thank you for posting your code.  You clearly know almost nothing about LabVIEW, else you would know about Controls and Indicators on the Front Panel, what a sub-VI is (it is analogous to a Function in c), and how to use the Connector Pane (the way to get wires in and out of functions).  There are an excellent on-line set of LabVIEW Tutorials that will teach you the basics.  Among other things, you will learn how you can process an array of strings one at a time.  It will also explain the In-Place Element structure which you have mis-used in your code (you basically don't want it).

 

Bob Schor

 

 

0 Kudos
Message 7 of 29
(3,237 Views)

Scan From String is your friend here...

 

Oh, and always make the Display Stype visible when dealing with strings like this.  It makes things a lot easier to figure out what is happening.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 29
(3,226 Views)

i dont want to pass string from GUI, i need to do hardcode it in blaock diagram  and also i dnt want to use array of striing. How to pass different string to same block N times.

0 Kudos
Message 9 of 29
(3,215 Views)

@punee wrote:

i need to do hardcode it in blaock diagram  and also i dnt want to use array of striing. How to pass different string to same block N times.


By definition, it sounds like you need an array of strings.  How else are you going to pass different values?  Or are you talking about using this converter in multiple parts of your project?  If that is the case, you want to turn this code into a subVI and just call it directly.  You will need to use controls and indicators to be able to pass your values in and out and bind them to the connector pane.

 

May I recommend some tutorials

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 29
(3,202 Views)