Quantcast
Channel: PC-DMIS User Forum - Forums
Viewing all articles
Browse latest Browse all 11658

Assignment Values Not Updating Properly

$
0
0
I am having a problem with my assignment values not properly updating after being set in my Basic script. If I put my cursor on the line that calls the Basic script in the edit window of my part program; press F9 to edit the script; and simply execute the script, everything works great. I can immediately see in the part program edit window that my assignment values have changed to the values being sent from the script. But, if I execute the part program, these values do not change until after the part program has finished running...so, I am forced to run each part program using the assigned values from the previous part program run.

I didn't know if I am overlooking some setting that updates the values after the program run or what? I am using PC-DMIS 2011 MR1

In my Basic file, I create an Application Object and a Part Object:

Dim PCDMISAPP as Object
Dim PCDMISPart as Object

Set PCDMISAPP = CreateObject("PCDLRN.Application")
Set PCDMISPart = PCDMISAPP.ActivePartProgram

'//Declare variables. Ex.:

Dim Serial as String

Serial = "ABC123"

'//Then I create 2 command objects and assign my Basic Variable value to my PC-DMIS variable

Dim Cmds as Object
Dim Cmd as Object

Set Cmds = PCDMISPart.Commands

For Each Cmd In Cmds
If Cmd.Type = ASSIGNMENT Then
If Cmd.GetText(DEST_EXPR, 0) = "SerialNumber" Then
bln = Cmd.PutText("""" + Serial + """", SRC_EXPR, 0)
Cmd.ReDraw
End If
End IF
Next Cmd

And then in my PC-DMIS part program, before I call this script, I Assign SerialNumber = ""

ASSIGN/SerialNumber = ""

Granted, I am simply mimicking what was already set in place in the way of passing values to PC-DMIS assignments from a Basic script by my predecessor, who passed away; so, I am not entirely sure how the GetText, PutText, and ReDraw functions do or what the bln is.

Anyway, any help would be greatly appreciated why the values update when I simply execute the Basic file and why they don't update until after the part program runs if I execute the part program.

Thank you!



Viewing all articles
Browse latest Browse all 11658

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>