question

Nicole S2 avatar image
0 Likes"
Nicole S2 asked Ralf Gruber answered

ongoing number on items

Hello everybody,

I got the following question:

I need every item leaving my source to be labeled with an ongoing number starting with the number one.

By setting back the simulation duration to zero, the items in the next run should also be labeled beginning with the number one.

How can I set this setting? I know that I can use the Trigger on Exit but I am not sure.

Furthermore my sink should in the end list all items in the incoming order because for instance through quality controls there will be turbulances. This order should be shown in a global table.

How can I achieve this?


Thanks ahead,

Nicole

label items
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joshua S avatar image
3 Likes"
Joshua S answered Nicole S2 commented

Take a look at this model and see if it does everything you wanted it to. The source has a label on it called "Part", which resets to 1 on reset if you toggle the button in the labels window. Then on the creation trigger, it sets the items label "Part" to the same label as the source's "Part" label then increments the label.

The table has an on reset code that deletes all the rows. The sink will store the label value of the part that came in the table as the items enter it.

ongoing-example.fsm


ongoing-example.fsm (23.0 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Nicole S2 avatar image Nicole S2 commented ·

Thank you very much! It´s working.

0 Likes 0 ·
Ralf Gruber avatar image
1 Like"
Ralf Gruber answered

Hi @Nicole S2,

sorry for the late reply. The error messages occur due to me using some commands in my 2019 model, that have been implemented post 2017:

- "fromNum" can be replaced by the older "numtostring" to convert a numeric value to a string
- "+" can be replaced by "concat" to combine multiple strings to one

If you want me to fix it, please post your model. You can give it a shot yourself by looking up the commands above in the user manual.

Good Luck

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ralf Gruber avatar image
0 Likes"
Ralf Gruber answered Nicole S2 commented

Nicole,

here is a small sample.

Look at the exit trigger of the source for the consecutive numbering and the entry trigger of the sink for the logging into a global table. Both are slightly modified standard pick list options.

Ralf

consecutivenumberingandtablelog-1902-rg.fsm


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Nicole S2 avatar image Nicole S2 commented ·

Thank you very much! It was very helpful.

0 Likes 0 ·
Nicole S2 avatar image Nicole S2 commented ·

Hello @Ralf Gruber,

at first thank you for your help! But I have one more question:

I Have tried it and took over all the settings but in the 2017 Version I´m getting an error message for my source

"Flexscript Error MODEL:/Source1>variables/exittrigger Line 9 Unknown command fromNum being called
Flexscript Error MODEL:/Source1>variables/exittrigger Line 9 Could not resolve correct operator for + operation. Left side type is string, right type is (invalid)
Flexscript Error MODEL:/Source1>variables/exittrigger Line 9 Could not resolve correct operator for = operation. Left side type is string&, right type is (invalid)
Flexscript Error MODEL:/Source1>variables/exittrigger
Could not finish parsing because of previous errors."

May you tell me what I made wrong?

Thank you very much!

Best regards,

Nicole

0 Likes 0 ·