Hold last value on unconnected tunnel in case structure
I have a true/false case structure as below. I am using it to run some code when an input is true. False condition is empty.
after performing some calcs I tunnel the value out, I wish the false condition to hold the same value,
how do I achieve this?
Use default if unwired returns a 0 value which I don't want.
Thanks
Solved!
Go to Solution.
hydzik wrote:where do I create the shift register?
I assume that this is running inside of another loop. You would put the shift register on the loop. If not, then use a feedback node.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
FB Node.png 15 KB
Similar Messages
-
Multiple boolean values to be used in case structure
Hi,
I am trying to implement a case structure with multiple boolean cases and am having trouble with that. What I want to do here is : I have a set of 5 values, each of them being "true" or "false". For each "true" value, I have a certain set of steps to be executed. The "false" of each can be ignored. Ideally, I would like to have a case structure for the 5 "true" cases. I am not sure how to go about wiring these boolean outputs to my case structure. Also am using LabView 6.1.
Any ideas?
Thanks,
Sukanya
Solved!
Go to Solution.Additional comments regarding code:
It is a mistake to configure the serial port inside the loop. This is a waste of time and resources. Configure outside, read in the loop, and close outside after the loop is done. The flushing of the buffer would be part of the "configure outside".
The default values of the controls for the VISA Configure Serial Port VI are such that the termination character for reads is enabled, and the character is set to a linefeed. This means the VISA Read will read until it sees a linefeed or reaches the value wired to its byte count input. Thus, the VISA Bytes at Serial Port isn't really necessary.
You should not rely on the settings in the LabVIEW option for automatic error handling. You should explicitly handle errors in your code. Thus, you probably want to stop the loop on an error and provide a dialog via the Simple Error Handler. -
In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
Thank you.
Solved!
Go to Solution.
Attachments:
TEMP.vi 25 KBIt took me some time to figure what you are trying to do but I think I have it now.
The SR is still required.
What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
OR
2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
Ben
Message Edited by Ben on 05-05-2010 01:31 PM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
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 . -
Exception aggregation - Last Value
Hi,
We are having requirement where we have a table in non R/3 system for SKU - Customer level closing stocks on particular day are maintained. We want to create a cube for the table in BI. This table contains entries for SKU + Customer for diff days. We want to show the closing stock of last(/latest) day for which Customer+ SKU record exists. To achieve this we have used Calculated Key figure on Closing stock with Exception Aggregation - Last value with ref to Calendar Day.
It woks fine only if I have Customer & SKU both used in query. But we have to show these stocks aggregated on Plant level. (Customer are linked to Plants and it is directly avbl in our cube). In this case aggregation does'nt work.
Lets say following are the closing stocks for SKU- M1 & 3 customers from Plant = 1101
date-> 1/1/2007 2/1/2007 3/1/2007
Cust1 10 15
Cust2 20
Cust3 25
In above case if i have to see closing stock on 3/1/2007 for SKU-M1 @plant 1101 (sum of latest closing stock @ all customer sites under plant 1101), i should get = 60 (152025). But it gives me 15 only.
Could anyone explain how to design a query for this? Or in cube design/uploads it can be managed.
Regards,
Vikram.Hello Vikram
One possible solution I can think of is to use an extra ODS in order to hold your data in an aggregated form that suits you. Unfortunately the exceptional aggregation behaviour does not work outside reporting thus in the transfer rules from your data provider to this new ODS you should add a formula checking whether the new record to be transfered to the ODS has a date newer than the ones already transfered in the ODS. Else it should skip the current record and proceed to the next one.
Another possible solution would be to use the APD and transfer the results of the query you are already playing in an ODS (this way you take advantage of the exceptional aggregation behavior) and by transfering your records to a second ODS you can achieve the aggregation you need.
Assign points if any of the above helped -
Last value from a loop and values inside the loop
Hi
Sorry about the confusing heading above, but its late at night and better words do not occur to me rightaway. Let me explain my situation.
I have a single instrument (a voltage source) that is being swept from one value to another for an experiment. It has three VI's : 1. enable o/p. 2. Set a voltage output level. 3. diable o/p.
I am using the error in and error out pins of instrument vis to properly sequence operations. I connect the error out pin of VI 1 to the error in pin of VI 2. Each of these errors is a cluster of three values.
When I try to wire the error out from VI 2 inside the loop to VI 3 outside the loop, the wiring breaks as I am then trying to connect an array (a 1 dimensional n member array of error outs) to a single error in pin. Trying to connect it to an array outside the loop is obviously the same. (I am making an assumption here - while the loop is running, I do not need to make certain of the sequencing of operations by putting a feedback node on VI 2 - that would mean something quite different in any case.).
So, how do I pass the last value (in this case, the error out cluster from the last stage) to error in pin of VI 3 ?
I have read that it might be possible using shift registers. I am quite new to LabVIEW. A somewhat detailed description of what I need to do would be nice.
Thanks.Hello,
There are basically two options:
Handle the errors outside the for-loop
Handle the errors inside the for-loop
For you solution 1 is the easiest achievable, after the for loop use the 'Merge Errors' VI this will change the 1d-array into a cluster. The downside is that if an error occured later states of the loops don't know this
Solution 2 uses the shift register you mentioned. To use this you have to right-click on the right hand-side tunnel of the error wire (where it leaves the for-loop) and select shift register, sequentially your mouse pointer changes into an downpointed arrow, click on the entry tunnel on the left of the for-loop. What happens is that an error in the for loop is remembered into the next iteration (use execution highlighting to watch these)
Here is some code:
A good start might be:
The link to the LabVIEW Learning Center is here
Ton
Message Edited by TonP on 09-25-2006 08:01 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
Example_BD.png 5 KB -
I just realized that the self-explanatory "Conditional Indexing" feature of a Loop introduced in LV 2012 has an interesting feature:
You can actually have a conditional Last Value. Unfortunately, it is not very useful, since, if the condition is False, the returned value appears to be the default of the wire type (in the illustration above, it would be 0). I have no problem with that particular value, but I am just questioning the usefulness of the feature.
If you are not indexing the output of a loop, you can then use something like this, which gives you the opportunity to at least chose what value to output in each case:
Now I am sure that our LabVIEW aces have already found a zillion use-cases for this feature, but I haven't...X. wrote:
Correct, and I should have formulated this differently: what happens in case all conditions are FALSE (as illustrated in my minimalist example)?
Like you said, it outputs the default value for the data type.
What I was missing is how the "Last Conditional Value" could replace that
It can't, because it doesn't have the two inputs that the shift register has. It's new functionality which is essentially like a shift register with no input terminal on the left side. Incidentally, you might wish to check out what happens if you run the loop and put a value in the tunnel and then run the loop again without inputting a new value. I'm guessing that you will get the existing value, but it's also possible that you would get the default.
Try to take over the world! -
COPA - New value field defined as "Last Value"
Hi experts:
We have defined a new value field that it is integrated as a 'LAST VALUE' instead of 'SUM'. However, when posting different entries the amount continue to sum instead of showing the last value. The new value field has the same behaviour as a sum value field. In KE30 all entries are summarized and in table CE3XXXX I can see all entries summarized.
Now, I have to entries (100 + 125) for the same characteristics and the value field show the total amount 225 instead of the last value 125.
Thanks in advance for your help
Best regards
JoseHi,
The 'last value' is typically used for no of employees or some similar value where the last number is really important. In such cases it does not make sense to use this field in KE30 reports and take the sum of these values.
In such cases only the last entry posted is important from reporting purpose. Also this type of value fields are important in planning.
regards
Waman -
How to determine the "Last Value" in exception aggregation
Hi gurus,
I have a KeyFigure with an exception aggregation -Last value- by time.
I report on a multiprovider ("containing" a infocube and a realtime infocube with BPS-InputLayout). I can correct separate Items with this BPS-Layout. So, at the end I have 2 values for one item.
So, by these facts, my report shows the the last value for the specific KeyFigure, but I expected that both values (the value in the infocube and the correction via BPS)are sumed up.
As this is due to the exception aggregation not the case, I could "overwrite" the normal value in the infocube with the BPS.
But SAP determines the normal value in the Infocube as "Last Value", not the one in the correction cube, which is entered via BPS.
How does SAP determine the "last value" as I can´t see any date...
Thanks in advance!Thank you for your answer...
I got the soltion by myself.
I thought, Last Value means the last Value, depending on the time, but in my opinion the function last value should be called "Greatest Value".
All figures with the same value for the reference characteristc are aggregated anyway. -
Using different hierarchy in a query and last value error
Hi guys,
there is a hierarchy for customers in the 0Customer Infoobject which I should use in my query.
I have activated the hierarchy in the query and now some results are not appearing but red crosses "x" are shown.
And the error message: The function Calculate Results as ... could not be applied everywhere.
I know that I am using the result as "last value" for some columns because I need them there (for example: to determine the last value for the credit limit of the current month). I think these columns where I am using the last value calculation are only affected.
I mean my query has a lot of characteristics and key figures and I was told that a hiearchy for customers which is available should be used. But now there are these red crosses.
I don´t see any other solution as not to use this specific hierarchy.
Has anybody a suggestion what could be an argument to use or not to use a hierarchy?
Is it sometimes like in my case that a hierarchy is not possible to use?
Thanks in advance!Hi,
say for example your customer hierarchy is customers grouped under region. You can maintain this region as one of the attribute of customer and you can display this attribute in the report. Indirectly, this will give similar output to that of hierarchy.
But lot depends on how your hierarchy is formed, before commenting whether it can be moved to master data attributes.
Thanks. -
How to hold the values as it's not holding the values when it cross 255
DATA : fval1 TYPE edidd-sdata.
DATA : fval2 TYPE edidd-sdata.
DATA : fval3 TYPE edidd-sdata.
DATA : fval4 TYPE edidd-sdata.
DATA : fval5 TYPE edidd-sdata.
DATA : len(3) TYPE n.
values1 = wa_final-low.
values2 = wa_final-high.
IF wa_final-high IS NOT INITIAL.
CONCATENATE values1 values2 INTO fval1 SEPARATED BY '-'.
ELSE.
fval2 = values1.
ENDIF.
IF fval3 IS NOT INITIAL.
IF fval1 IS NOT INITIAL.
fval = fval1.
CONCATENATE fval3 fval INTO fval3 SEPARATED BY '/'.
ENDIF.
IF fval2 IS NOT INITIAL.
fval = fval2.
CONCATENATE fval3 fval INTO fval3 SEPARATED BY '/'.
ENDIF.
ELSE.
IF fval1 IS NOT INITIAL.
fval3 = fval1.
ENDIF.
IF fval2 IS NOT INITIAL.
fval3 = fval2.
ENDIF.
ENDIF.
DATA : len(3) TYPE n.
len = STRLEN( fval3 ).
IF len > 250.
fval4 = fval3+0(250).
fval3 = fval3+250(5).
* CONCATENATE fval4 fval3 INTO fval5.
ENDIF.
IF fval4 IS INITIAL.
wa_final1-varbl31 = fval3.
ELSE.
CONCATENATE fval4 fval3 INTO fval5.
wa_final1-varbl31 = fval5.
ENDIF.
MODIFY it_final1 FROM wa_final1
TRANSPORTING varbl31 WHERE agr_name = wa_final-agr_name.
at this point also it's not holding the values when it exseds 255
kindly please helpH friends ,
i am not the expert at the same time i know some thing in abap
fval4 = fval3+0(250).
fval3 = fval3+250(5).
in the above case fval3 have 255 char at that time iam transporting 250 char to fval4 with this statment
fval4 = fval3+0(250).
and iam keeping the remaining 5 char in fval3 with this statment
fval3 = fval3+250(5)
so that i can push some more values in fval3 and at i am
CONCATENATE fval4 fval3 INTO fval5.
so that fval5 may get all values this is the way i try but fval5 is not holding all the values
i asked solution for that
fval 3 = fval3+250(250)
dosen't have any meaning i know that friend
my question is how to hold the remaining value -
Tunnel mode: indexing with a case structure
Hello,
I have a code like the one attached to this message.
I have a case structure in a while loop, and I would like to transfere some data from my case structure to outside the while loop in indexing mode tunnel.
This is to accumulate results (or to save results) following each iteration.
My problem:
I dont want any value in the False case of the case !!
How can I get rid of that? I do not want to use default value for unwired case and I dont want 0.
Many thanks
Attachments:
Untitled 1.vi 9 KBYour VI is saved in LabVIEW 2014. So you should have this. Right-click on the output tunnel of the loop. There is a tunnel mode->conditional.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Conditional Indexing Tunnel.png 7 KB -
Last Value Exception Aggregation
Hi.
I have a KF with excpetion aggregation with Last Value based on CALWEEK. I have to calculate the 'for the month' and the YTD value for this in a query. When I execute the query, the system fetches the last value for the month for 'for the month'. However, it gets the same last value for the YTD as well. How do I change this to get the sum of last value of all the months for the YTD Value. For example, if I am looking in sep 2008, the for the month value should be the last week of Sep 2008 and the YTD should be the sum of all the last values for months Jan -08 to Sep-08.
Cheers
AnandHello Vikram
One possible solution I can think of is to use an extra ODS in order to hold your data in an aggregated form that suits you. Unfortunately the exceptional aggregation behaviour does not work outside reporting thus in the transfer rules from your data provider to this new ODS you should add a formula checking whether the new record to be transfered to the ODS has a date newer than the ones already transfered in the ODS. Else it should skip the current record and proceed to the next one.
Another possible solution would be to use the APD and transfer the results of the query you are already playing in an ODS (this way you take advantage of the exceptional aggregation behavior) and by transfering your records to a second ODS you can achieve the aggregation you need.
Assign points if any of the above helped -
White tunnel in a case structure at every output
I´m working with a TCP READER in a case structure. But every output fron the case get white tunnel. What`s happening?
A white tunnel on an output of a case structure indicates that the tunnel is unwired in at least one case. If you're using LabView 6.1 or 7, one option is to right-click on the tunnel and select Use Default If Unwired. But I prefer to wire to the output tunnels in every case: it removes any question about what value is presented to the case outputs.
-
Hi All!
I am having requirement in BEX as follows:
This is the existing scenarion.
Mat. Gr. Fisc Yr/P Sales Qty MAP Raw MatCost(Cumm)
(Cumm)
X 09.2005 10 5 50 (10*5)
10.2005 20 4 80 (20*4)
11.2005 30 7 210(30*7)
Total 30 5.3 210
My new scenario will be that the MAP should be taken always as the last value i.e 7 in this case and it should be multiplied by the sales quantity to derive the Raw Material Cost i.e the New Raw Mat. Cost should be 70, 140, 210 for fiscal period 9,10 & 11 respectively. The sales qty & the Raw Mat Cost have been shown cummulative. How can I achieve this in the BEX? Please advise me. ThanksHi Madhu,
Displaying a Material BOM
Displaying a Structure Overview
General Functions in the SAP Environment
General Functions in the SAP Environment
This link will give you all above details. This helps in calculation . sure it solves the problem.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d03a090-0201-0010-0597-f87213b26d53
Thanks
VJ
Maybe you are looking for
-
The Volume can't be used & will be ejected because it is no longer avail...
Fresh Mac Mini Server, all updates, humming along beautifully. Every day or two, all my AFP users get kicked off our one share point (located on an external FW800 RAID array) with this error: "The Volume "Work" can not be used and will be ejected bec
-
SOAP Adapter XI 3.0 Response HTTP 402 ICM_HTTP_TIMEOUT
When i sent a soap request to a ext. Server all is fine. But at the moment to get the response following error come up. Error when receiving by HTTP (error code: 402, error text: ICM_HTTP_TIMEOUT). What is wrong? IP-address of the client: 169.254.25.
-
Cannot Left Click anything in AE
This happened today, everything has been working just fine, but now when I start Adobe After Effects CS4 (or CS5) either or, I can left click New Composition, but when the menu opens up to select 1280x720 etc, I cannot left click on anything, as I ro
-
Mac Mini redirect LineIn to LineOut
Guitar is connected to the MacMini and I want just to hear the sound which I play, without running GarageBand. I've checked, the power of signal is enough for this (I did this by going to System Preferences-Speech-Speech Recognition, button Calibrate
-
Executing java program in oracle
Good day everyone! I created a small java program. import javax.swing.JOptionPane; public class LogOn { public static void main (String [] args) {} public static void ShowMessage(){ JOptionPane.showConfirmDialog(null, "Hello", "Info", JOptionPane.PLA