Got it. Just incase any one else comes across this.... GVLP.iBatchID := GVLP.iBatchID + 1; GVLP.wsBatchID := WConcat("0000", INT_TO_WSTRING(GVLP.iBatchID)); GVLP.wsBatchID := WRight(GVLP.wsBatchID,5); GVLP.wsBatchID := WConcat("RUNA",GVLP.wsBatchID);
So I've had some more thoughts on this and I am wondering if commands exist that will let me do this.... Take the iBatchID Integer and concat together "0000" and iBatchID to get "0000###". Then is there a command where I can take just the 5 characters from the Right of this? Thus removing the excess leading 0's? Then I can use another concat to put "RUNA" in front of it. Obviously I know concat is there, but is there a command that will allow me to just select the 5 characters from right to left...
I may not be following what youre trying to explain and I apologize if that is the case. What I have found is... if I create a text block on my VISU and set the text to "RUNA%05d" then set the text variable to "GVLP.iBatchID", this outputs exactly what I need "RUNA0001, RUNA0002, etc.". I just don't know to get that string into a Variable that I can use elsewhere. It would be great if I could use the concat and somehow tell it to use the format %05d for the Integer when concat'ing.
I have to be missing something here. I am unsure what output I should be getting from the StuSprintfW function.
"Why is your batchid a real, if you only have integer values?" because I don't necessarily know EXACTLY what I'm doing. How would that logic be modified if I were to use Integer rather than Real?
I am working on a project where I am trying to create a default string that is "RUNA#####", where ##### starts at "0001" and increments based on some other logic. I am able to make this work using the logic: GVLP.rBatchID := GVLP.rBatchID +1; GVLP.wsBatchID:= WConcat("RUNA",REAL_TO_WSTRING(GVLP.rBatchID)); The problem I am having it getting the RealValue to always be 5 Digits. Has anyone tried to do this and/or have any tips what I can try to get this to work??
I have been messing around inside the Alarm Manager and have not been able to come up with the solution I am looking for. I am looking for a method to come up with a BOOL tag that is enable whenever ANY Alarm is Active as well as a second BOOL tag that is active whenever an UNACKNOWLEDGED Alarm is active. The theory here is I want to have an Alarm Buzzer sound and a Red Light Flash whenever there is an unacknowledged alarm. When all Alarms are acknowledged, but there is still an active alarm, the...
Sorry for the delay in getting back to you, got buried in a bunch of other work. I looked over what you did, but I ended up sticking with the multiple frame approach. Only for the fact that with the multiple frames, I can set limits when I use "Write Variable" input.