08-08-2011 11:20 AM
Hello,
I am new to both diadem and VBS and I am having difficulties in translating calculations between excel and diadem. I know that diadem doesn't have the same cell by cell formatting that excel does but is there a way to either hide rows that do not meet a certain condition or a way to say use an equation of the form
=IF(H5> 0,J5+M4,0), where H is the conditional column and M is the resultant column?
Thank you
08-08-2011 05:25 PM
Hello ccimac,
You might want to look at the IIF function to help you solve that particular problem,
Example:
Call Calculate("Ch(""ResultNV"")=IIf( Ch(""Channel1"")>1,Ch(""Channel1""),NoValue)" )
This will create a NEW data channel called ResultNV that checks (in this example) whether a channel called Channel1 is larger than 1 or not. If it is, the value will the the actual channel value, if the values are smaller than 1 the software will replace the values with a NoValue - which is DIAdem's way of saying that a "cell" contains invalid values.
Does that work for your question? Feel free to ask if you have further questions,
Otmar
08-09-2011 08:24 AM
Thank you Otmar
this is getting to be quite helpful. however, my end goal is to say when column J is greater than zero then post column L into column M, it seems that this is the way to go for this case. If I wanted to post the value found in column L into column M for as long as J>0 would I have to do a for/while loop and if so what would it look like. Also, would it work for the the different values in column J
Much Obliged
08-09-2011 08:28 AM
what i am sayig is that column J is taken from inputs to a keypad. The information gathered involves thing such as job numbers, error codes, and such. Is there such a way to repost the initial value into subsequent rows until column J reads 0 again?
Thanks
08-10-2011 11:28 AM
Hi ccimac,
How about if you post an example file of what you're talking about. I'm not convinced that I'm following your description.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-10-2011 12:42 PM
here you are pay attention to columns M,N, and O. right now i am using something like in Doc2 to accomplish the same equation
08-10-2011 02:11 PM
Essentially I am looking for a solution like can follow this diagram when column a is not 0 then column D read the value from column C and Column B moved down one row I know I would probably be forced to divide by 2 to keep the value at 7500 instead of 15000
Much Obliged
08-10-2011 04:34 PM
these last wo posts are most important (contain the best insight into what exactly im doing. I think i might be running into a continuous loop but i am not certain because the script runs but does not produce the desired colum JbFinal so i dont quite know what is going on. But if i wee to get the summation to stop whenever colum FPM were equal to '0' would i also have to reset the result column JbFinal as well
Thanks and to all a good day
08-10-2011 06:50 PM
Hi ccimac,
If you would like to have a quick and easy way to calculate your new column. Just use this script code in the Calculator:
Ch(Result) = IIF(Ch("[1]/Speed")>0,Ch("[1]/Revs")+Ch("[1]/Torque"),0)
Be sure to use the correct chalnnel information. I hope that this helps. I will post a more robust way to do it tomorrow.
Regards,
Perry S.
08-11-2011 07:31 AM
hello perry,
i am just wondering wouldnt the IIf function add the entire channels together and not go "row by row" as my code does? You can see the examples in my two previous posts to clarify what i am doing