05-17-2018 02:34 AM
Hi together,
while starting the Sync Manager we have 2 post runs.
First with no informations of mom_post_update_sync_manager and sync marks and the second one with all informations.
Is it possible to start a third pp run with all informations like in the second one to fill the correct NC code for the simulation?
I have a problem to get env() variables from the 3rd channel for the first 1/2 channels.
Regards, Viktor
05-17-2018 08:47 AM
I'm not quite sure what you are asking for, but...
There are mom variables you can use to determine if you are
global mom_post_in_simulation ;# 0 (pure postprocessing), MTD, CSE, SYN (Sync Manager) global mom_postprocessing_mode ;# 1= from inside sync mgr, 0/unset = not
global mom_run_number ;# should equal channel???
global mom_number_of_runs ;# total number of channels being run
You can write a proc to glom the individual channel's output files into 1 file (run at end of case 3 above). Test for:
- posting from sync manager
- channel = last channel
Then add to "end of program" event.
I'm not sure about simulating inside sync manager (I've not tested that case) but I would guess the variables exist to test for that as well...
Hope this helps, otherwise if you could clarify your issue?
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
05-17-2018 10:46 AM
I had done some testing (about this subject) and stopped for a while (don't remember details about it) but I found this:
******************************** Open partRead in post MOM__halt mom_post_in_simulation = 0 ******************************** Right_click post on synced group Read in post MOM__halt mom_post_in_simulation = 0 Read in post start_of_program mom_post_in_simulation = SYN mom_run_number = 1 end_of_program MOM__halt mom_post_in_simulation = SYN mom_run_number = 1 Read in post MOM__halt mom_post_in_simulation = 0 Read in post start_of_program mom_post_in_simulation = SYN mom_run_number = 2 end_of_program MOM__halt mom_post_in_simulation = SYN mom_run_number = 2 Read in post start_of_program mom_post_update_sync_manager = 1 mom_post_in_simulation = SYN mom_run_number = 1 end_of_program start_of_program mom_post_update_sync_manager = 1 mom_post_in_simulation = SYN mom_run_number = 2 end_of_program ******************************** Post button sync manager Read in post MOM__halt mom_post_in_simulation = 0 Read in post start_of_program mom_postprocessing_mode = 1 mom_post_in_simulation = SYN mom_run_number = 1 end_of_program MOM__halt mom_postprocessing_mode = 1 mom_post_in_simulation = SYN mom_run_number = 1 Read in post MOM__halt mom_post_in_simulation = 0 Read in post start_of_program mom_postprocessing_mode = 1 mom_post_in_simulation = SYN mom_run_number = 2 end_of_program MOM__halt mom_postprocessing_mode = 1 mom_post_in_simulation = SYN mom_run_number = 2
So as Ken mentions (and above shows) there is plenty to consider.
05-17-2018 02:47 PM
Thank you for your detailed feedback.
First I need MOM_sync information in the first run.
- First run = start sync manager with "machine simulate" or "synchronize"
= no informations of mom_post_update_sync_manager
The first run is without any MOM_sync events or marks.
So is it possible to start a 3rd postprocess? Is there a method for it?
05-25-2018 04:37 AM
Now we have the situation while starting Sync Manager:
1. post run:
2. post run:
I need a 3rd post run with all seperate channel posts. I dont know, but is there a method to realize it?
Regards, Viktor
05-25-2018 09:31 AM
Are you saying you need a separate post for each channel?
Note you can modify post based on mom_run_number - the run number should match the channel.
Or do you want to take the output from the post (from within sync manager) and modify the G&M code somehow?
I'm still unclear what a 3 posting will add, that the 2nd doesn't already have.
What are you trying to achieve?
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
05-25-2018 10:25 AM
Hi Ken_A,
yes, I need a separate post for each channel.
But why? Because of env() vars depending on waitmarks.
So back to the situation while starting Sync Manager, another note:
- if click on machine reset buttot --> perfect result
- if click on post button --> perfect result
1. post run:
2. post run:
I hope you have an idea or another solution for this problem.
Regards, Viktor
05-25-2018 11:55 AM
What are you trying to accomplish?
Why do you need the info from the OTHER channels' sync codes?
I'm guessing each channel is posted in a separate "process", so the ENV variables don't carry over (nor do mom variables)
If you truly need this data, I would try writing to a (separate) text file during posting (maybe one per channel?) then parse as needed at start/end of program (or wherever) and set variables as needed.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
05-28-2018 05:49 AM
Hi Ken_A,
it is not so easy to explain.
One info to the env() vars, you can set an env() var in channel 1 and read the information in all other channels.
This variables carry over in other channels.
So if you set env() vars in channel 3, you dont get them in channel 1/2 ...
You will get the same results while posting a separate file. If you are in post_run 3, post_run 1 and 2 are finished.
Regards, Viktor
05-29-2018 09:52 AM - edited 05-29-2018 09:53 AM
Perhaps I'm understanding better...
You need data from channel 3 when you post channel 1 or 2?
Personally, I would:
- Write the data for each channel to a (separate) file while it is being posted
- In the actual posted file, write a piece of "marker" text (e.g. "INSERT DATA 1 HERE") where you need data from the other channel(s)
- after all 3 channels are done, close the last output file
- Open the 3 "separate" files, read their data, load into tcl variables/arrays/lists/ whatever
- now open each actual posted code file, process (read/write to a temp file), replacing the text "INSERT DATA 1 HERE" with the data from the "separate" file as appropriate.
- delete the posted code files, and rename the "temp" files to the desired filename.
As an example
- posted code goes into "CHANNELn.ptp" (e.g. "CHANNEL1.ptp")
- "separate" file data goes into "CHANNELn_DATA.txt" (e.g. "CHANNEL1_DATA.txt")
- read all 3 (or whatever) "CHANNELn_DATA.txt" files
- open "CHANNEL1.ptp"
- loop thru, writing every line into "CHANNEL1.temp" EXCEPT...
----- if line is "INSERT DATA 1 HERE", write data (from "CHANNELn_DATA.txt" files) as appropriate.
- After you are done creating all 3 "CHANNELn.temp" files
--- delete the "CHANNELn.ptp" files
--- rename the "CHANNELn.temp" files to "CHANNELn.ptp"
Does that make sense?
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled