Writing to 6 variables consecutively in 3 steps (Case Structure?)
I have two inputs which, on three different occasions, have different values. So my data input can be split up into three sets of two inputs.
When the first set of data is sent, the two inputs are processed and stored in indicator 1 and 2.
When the second set of data is sent, the two inputs are processed and stored in indicator 3 and 4.
When the third set of data is sent, the two inputs are processed and stored in indicator 5 and 6.
Unfortunately I can't go around this by using 6 different inputs. I need to have two inputs only in the beginning.
I've attached a file where I tried to do this with a case structure. However, the output tunnels are unwired in some of the cases, and I'm afraid that they'll assume new values and won't retain the values that the inputs sent to them.
Any help is helpful... naturally.
-Alex
Attachments:
problem.vi 16 KB
You could do something like below. Use a Ring to choose which case (adds a bit of error checking for you), Case 1 = 0, Case 2 = 1 Case 3 = 2 etc. Wire the output of the Ring through the case structure as well as your mathematical operation, then build an array out of your 2 indicator outputs and insert them into a 2 day array. This way the output for Case one is stored at index zero of your Value Holder Array, output for Case two is stored at index 1...
Dont know if this is what you were looking for, it is just one way to keep track of all your outputs.
Message Edited by jmcbee on 07-11-2008 10:40 AM
CLA, CLED, CTD,CPI, LabVIEW Champion
Platinum Alliance Partner
Senior Engineer
Using LV 2013, 2012
Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Attachments:
Problem.png 11 KB
Similar Messages
-
I try hard but do not managed, I can't get the variable situaded inside a step?
I have created my sequence object then my step object (I can get the right name of this one)
but I didn't find in the help the method allowing to get any value of the step variables.
Any idea? Thank youHi,
You obtain a reference to your step as an PropertyObject.
Using this PropertyObject reference you can use the PropertObject.GetValString|GetValNumeric|GetValBoolean.
Hope this helps.
Regards
Ray Farmer
Regards
Ray Farmer -
Pass the value of the current case in a case structure to a global variable for use in VIs.
I have built a large queued state machine (>100 cases). In each state, I run a VI that I have created. These VIs are usually not very different from one another. In many cases, I could simply use the same VI over and over again. There is only one problem with that. None of these VIs know which case to send the program to next. I have to change the value of the "NEXT_CASE" constants in the VI and save it under a new name to be inserted into each new case. Now my program consists of hundreds of VIs whose only difference is the value of their "NEXT_CASE" constants. This causes all kind of headaches when I have to insert new cases into the state machine, and it is just too much for me to deal with.
I need to be able to use a global variable to keep track of the current case within my VIs. I could change it from a string to a number and add or subtract from it to determine which case the program should go to next. Since I'm usually only skipping from one case to the next (or the previous) I could use the exact same VI in most cases. Can anyone tell me how to create a global variable that contains the value of the case in my case structure that I could use within my VIs to keep track of the current case? Let me know if you have any questions.Instead of defining the next state inside the subvi, why not do it in the main vi inside each state case? An output from the subvi could be used with a case structure to determine the next state. Sort of like, if the subvi returns 0 then next state is State3, else if the subvi returns 1 then next state is State4.
Message Edited by tbob on 08-19-2005 03:15 PM
- tbob
Inventor of the WORM Global
Attachments:
NextState.PNG 5 KB -
Using local variables with a case structure
I recently decided that I didn't want to nest a bunch of case structures for a program I am creating. I have two variables, N1 and N2, and I want to say execute Case 1 if the integer input to the terminal is less than N2. Case 2 if the integer input into the terminal is greater than N2 but less than N2+N1. Case 3, integer greater than N2 + N1, but less than N2+N1+N2. Case 4, you guessed it, Greater than N2+N1+N2, but less than N2+N1+N2+N1. When I try to type the variable name into the bar and use the ... like you do with integers it changes the variable name to a string.
Am I just thinking of this the wrong way? I have a sensor setup in a square and I am using a matrix card hooked up to the sensor bundle to send signals from each sensor to each other sensor, but not for those along the same sides.
TomI see the nested case structures which is what I didn't want to do, but I will have to because I am tired of looking at this. Thank you for the help on this. I appreciate it.
The sensor network is shown in the image included. Lets say we number the sensors in a clockwise direction starting on the lower left hand corner. Each element needs to both send and recieve data to all other elements except for the one in the row it is in. So sensor 1 would sent to sensor to sensors 5 - 18. Then sensor 2 would send to 5 - 18. Sensor 5 would sent to 1 - 4 and 10 - 18. Etc.
Lets say if this were a circular array it would be easy. Two nested while loops. And the only condition I need to worry about is that sensor N is not both sending and recieving at the same time. Each while loop, or for loop - doesn't matter, will start at 0 and go to N-1. Each i and j will have +1 added to them, and as long as they are not equal preform the data operation.
Just some fun logic to think about
Tom
Attachments:
rectangular.jpg 12 KB -
Container variables in User decision Step in BPM
Hello,
I am using User decision Step in BPM.
When i use only text in "Title for Display" the BPM is activated successfully and Status in SXI_CACHE also shows 0.
If I use container variables in "Title for Display" the BPM is activated successfully but status in SXI_CACHE shows 99.
It shows the below error
"Problem updating an integration process with object ID 073AF2C620F43E839B2903344DEE29BB. Symbol 'CE/KO' expected at position 1 in expression ''
Please suggest.
Thanks,
ShabariHi Shabari, did you follow the steps for declaration of variables as in [SAP help for user decisions|http://help.sap.com/saphelp_nwpi71/helpdata/en/42/c2a19fb4511d65e10000000a1553f6/content.htm]? How did you define your variable?
Maybe discussion [in this thread|BPM activation Error in SXI_cache; can help, it is unanswered though.
Regards, Martin -
Set expression's variable in the same step
I probably asking a rhetorical question, but does it exist a way to set an expression's variable (say for load sequence dynamically) in the same step (sequence call)?
I have a situation where I need to read a sequence path from the database and then call this sequence. If I try to do that in pre-step it doesn't work, TestStand tries to evaluate the sequence file path expression when call the step and before the pre-step is executed.
So, what I doing now, do this in two steps, read database first and then do sequence call.
Similar problem is for Message Popup, I need to read the message to display from the database.
Two steps works fine but are not convenient to use. We create our test sequences from custom step types and it would be easier to drop just one step instead of pair of steps in order. Or, is it a way to bind two step types together and always drop two if one is selected?
Sergey Kolbunov
CLA, CTDDah! I didn't know about the OnNewStep when I posted this.
Juergen, thank you, this is interesting example but not related to my question.
My concern is mostly cosmetical. I can do the job in two steps, but because these two steps will always come together I'd like to combine them in one step in the sequence. This is not possible because the second step depends of the first step output.
Looks like my second example for Message Popup is not true, at least it works if I set the message in the step's Pre-expression. But take a look to my Sequence Call.seq. How to obtain Sequence Path specified by expression in the same SequenceCall step?
Sergey Kolbunov
CLA, CTD
Attachments:
Message Popup.seq 6 KB
Sequence Call.seq 5 KB
Dummy.seq 6 KB -
Unspecified error when writing variant shared variable
Hi everybody,
I'm getting an unspecified error (-2147467259) when trying to write a variant to a shared variable hosted on my cRIO device.
I'm using a cRIO chassis as a headless controller that dynamically finds remote ScanIO chassis at startup. Similar to the LabVIEW example, the cRIO finds the chassis and generates clusters containing the IO container refnums as well as other information about the modules. I generate two arrays (local and remote) of these clusters, turn them into a variant, and publish it as a network published shared variable so they can be used in a remote PC to add or remove remote channels as needed.
Has anyone had this sort of issue before? I'm new to real-time so I'm not sure if I have violated some canon here or not Thank you for your help
-JordanJnelson,
There appear to be a few Corrective Action Requests (CARs) associated with using shared variables of the variant data type. The closest one I could find related to your issue was CAR #291679 where Wiring FieldPoint IO Point into shared variable throws error -2147467259. All CARs that I could find about using shared variables of the variant type threw the same error you are seeing and are feeding into it less standard datatypes (FieldPoint IO, LVClasses, IMAQ references).
To get a more general overview of your problem, does this error come up the first time you try to write to this shared variable or does it come up somewhat randomly? It would help if you could tell us exactly what hardware you are doing and if you can recreate this issue by simply deploying a program that writes a constant cluster with the same data types into that shared variable.
A possible workaround for you to try would be using the Flatten to String and Unflatten from String functions and pass that through a string shared variable. This has seemed to work for others in the past.
Matt J
Professional Googler and Kudo Addict
National Instruments -
JAVA writing a Flash variable?
Hi all,
This is my first post here (I'm a photoshopper)! I am trying
to get JAVA to see and then write a flash variable. It's a simple
thing - I think. I am running SlideshowPro which outputs a variable
my AS code:
var ImageNumber = new Object();
ImageNumber.onImageData = function(eventObject):Void {
trace(eventObject.data.number);
my_ssp.addEventListener("onImageData",ImageNumber) ;
So I have the variable (checked in the output window), now
how do I get JAVA within the HTML that the .swf is embedded to see
and then write the var (ImageNumber)?
I have really tried hard to find this answer and understand
it. Help my little brain - please.
Thanks for any reply,
CraigHi Wilburwu,
thank you for posting your question here at the National Instruments forum. This behaviour sounds strange.
Which NI cRIO-Driver Version are you using?
Where are the shared variables hosted at?
Best regards
MarianO -
IS there is any another Area for writing ABAP Codes ( Variable Exit)
Can we extractor & aggragate the Data from Lookup DSO . & show in Report of (ODS1) .
Can we extract/Aggregate Data at run time of Query .
Please help me what are the Area/Tool where we can write the ABAP Codes in displaying a report in BEx QueryHi
Point 1: U r saying DSO is BI 7 &ODS 3.X .But Actually we will use lookup while uploading
Ex : Data Flow : ODS1 - CUBE (Before Uploading data to Cube from ODS1 you need some data from ODS2.Then you will use lookup at teh ODS1-CUBE TRansformation level)
Point 2 : As per my understand when you can execute the query the OLAP Processor will pick the data display the in theoutput as per your stucrure.Means during Run Time of query
1. Extracting Data from Cube
2. Claculating based on the Query Structure deisgned ( Means Aggregarion of Data etc.......) and displays the output.
Point 3: Customer exit for BEx query will written in SE38/CMOD.
Regards
Ram. -
More than one variable at a time in case statement
hi i am using oracle 10g database.
can it be possible ?
in if condition we can have more than one variable in one condition
if a=100 then
b:=200;
c:=300;
end if;
how it will be in case statement ? i have searched lot on internet but didnt get
case
when a=100 then 200, 300 ... ???
thanksHi FRNzzz!! wrote:
hi i am using oracle 10g database.
can it be possible ?
in if condition we can have more than one variable in one condition
if a=100 then
b:=200;
c:=300;
end if; how it will be in case statement ? i have searched lot on internet but didnt get
case
when a=100 then 200, 300 ... ???
thanksnot sure if I got your question correctly, is this what you are looking for?
SQL> ed
Wrote file afiedt.buf
1 declare
2 a number := 100;
3 b number;
4 c number;
5 begin
6 case
7 when a = 100 then
8 b := 200;
9 c := 300;
10 when a = 0 then
11 b := 300;
12 c := 400;
13 else
14 b := 0;
15 c := 0;
16 end case;
17 dbms_output.put_line('a :'||a||' b :'||b||' c :'||c);
18* end;
SQL> /
a :100 b :200 c :300
PL/SQL procedure successfully completed. -
Is it possible to create a Text Variable that uses text from a structure?
The question is this -
I have created structure which consists of 4 high-level nodes. Each level one node contains a different number of level 2 nodes. Is it possible to use the text from these nodes in replacement path variables?
Example, my structure levels are:
GS
SA
OOI
COGS
If a user drills into COGS, I'd like to display the text "COGS" in the header but I have not found a way to capture it. From what I can tell, the variable editor only allows Characteristics and their text/key or user input text. I don't see an option for Structure level/node text.
Anyone know if this is even possible?
Thanks!HI!,
I think you should separate programming for AS3 and for FLEX,
this is beacuse they both use different class packages. If you want
your classes to be FLEX compatible you need to extend them from
Flex Objects and not from AS3 Objects.
In sum, if you want your class to be processed by let's say
the application object then you need to extend it from
mx.core.UIObject.
This is because there are lots of methods that FLEX uses to
place your class on the screen that are not used by normal AS3
applications. -
SAP BI Step by Step case study
Hi BI-experts!
I would like to start with SAP BI. My goal is to get familiar with connection of SAP BI with SAP FI/CO.
Can some one tell me how to find more or less real case study e.g. from SAP Best Practices on
http://help.sap.com/bp_biv270/ ?
I would like to load master and transaction data from SAP ERP system and analyze these data in SAP Bi 7.0.
Any helpful information will be very appreciated!
Thank you!
Axel S.Hi,
Please find below links...
Practical SAP BI Step by Step Guides
Business Intelligence : Steps to get started with SAP BW
https://www.sdn.sap.com/irj/ sdn/wiki?path=/display/BI/ StepstogetstartedwithSAP BW&
SAP Business Information Warehouse Scenarios
http://help.sap.com/bp_biv335/ BI_EN/html/Bw.htm
SAP BW Business Warehouse - Introduction
http://www.thespot4sap.com/ Articles/SAP_BW_Introduction. asp
Info object,infocube,infosource, datasource,commn structure, extract structure ..etc..
http://www.erpgenie.com/ sapgenie/docs/MySAP%20BW% 20Cookbook%20Vol%201.pdf
Thanks==points
Regards
Sudheer -
Case Structure timing/ writing data to a excel
Hi all,
I have written a program that has the main functions of allowing the user to generate a random number between either 0-10 or 5-15 by using the labelled switch. I also have a control which can switch this function on or off. When this switch is true it will display the random number and also write this number to an excel spreadsheet every 1 second (I hope). When false this will stop displaying the number and hence not write the number to a file.
However, I am having the following issues:
1. Excel file is corrupt once I begin to write the generated numbers to the spreadsheet. (I am trying to write to a .xlsx file)
2. Once I begin to try write the numbers to file, the elapsed timer only displays the time is 1second intervals rather than the full time.
I changed the .xlsx file to a .csv file and this solved issue 1. but it only recorded one random number rather than the numbers that were generated in that time since switched on/off.
Should I have the write to spreadsheet function in the timed case structure?
Should the file path control be outside this case structure?
Have I set up the write to spreadsheet VI correctly?
If anyone could help with these issues that would be a big help.
Thanks!
Attachments:
Random Number tester.vi 30 KBlneill65 wrote:
There is still an issue with the elapsed time. Once I begin I turn the top boolean control to true, the elapsed time begins changing at the set time increment inside the case structure. Is there anyway to stop this from happening?
Your elapsed time display is independent of the boolean switches because it is on the toplevel loop diagram. I am not sure why you place a five second wait inside the case structure if you want to write once per second.
I am not sure why you have two sequential case structures since the calculations of the first structure is not needed unless the other case is also true. Why not place it inside the true case?
You should also adhere to some basic coding styles. Avoid overlapping and floating objects, hidden wires, right-to-left wiring.
If it is sufficient if the code reacts once per second, just run the loop with a 1 second wait. If you don't want to display a stale random number if the switch is off, place the indicator after the case structure.
Here's a quick draft. Modify as needed. I probably would use an event structure, but let's keep it simple at this stage. You should also modify it so it does not try to write with an illegal path and also retain the selected path once selected. I propably would use a file dialog instead of a FP Path control.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Random Number testerMOD.vi 9 KB -
basically I just need to know how to make my case structure express a certain case for a specified amount of time. thanks...
Two ways
Use a Functions palette>>Time and dialog>>'wait' function and set a 1 minute delay( 60000 m sec) delay
If using a state machine, do a state transition only after the specified time has elapsed, as shown in attached vi
Hope this helps
Regards,
Dev
Attachments:
n sec wait.vi 29 KB -
Case Structure Ranges Determined From Input Variables
Hello,
I am trying to write a vi that will read in a random number, and depending on how close or far away from the intial given value it is, it will do something different to the value using a case structure.(Not positive this is the best way)
Ideally I would like to somehow incorrporate the value that is on the front panel from the user, into the different ranges so they are not set. Is there any way instead of using [ ..10, 11..15, 15.. ] I could use the [..(indicator - 5), (indicator-4)..(indicator +4), (indicator +5)..] as my three different cases? Or is that just crazy and I should be trying to use a different type of structure maybe?
Thanks in advance for the help,
KTWhat if you would subtract the reference value before wiring to the case structure?
(assuming you are dealing with integers)
LabVIEW Champion . Do more with less code and in less time .
Maybe you are looking for
-
How to print all records in database ?
Hello, I am developing a small Database System. Which is used to store some information about student and then print that record, which I want to print. I have used JPanel for Printing single record. As like When I insert student id in TextBox. which
-
Is there a way to wake an ipad up by detecting motion with the front camera?
I am using the iPad for an HMI Display To control a machine and want it to be able to wake up from sleep just by detecting motion with the front camera rather than having to push any buttons on the iPad, is this even possible?
-
All of a sudden all of my contacts as displayed on my iPhone have lost their formatting. So the numbers all read as 1234567890 instead of (123) 456-7890. And, what's worse, is when I go to the texting app, all of my texts are still there, but inste
-
How do I determine the order of photos displayed in slideshow?
I'm using my ipod to teach art, using a dlp projector. I've got pictures sorted by topic. But I need to know how to organize the photos to display in the order I want them to. Can you help? Thanks! Mike
-
Persisting Data across different WebApps/Sessions
Hello all, I am developing in an environment where multiple (web & enterprise) applications are developed and deployed separately to the same clustered WebLogic infrastructure. The applications are all owned by the same company, and usually co-exist