cancel
Showing results for 
Search instead for 
Did you mean: 

Process Simulate logic block function, ReadFromFile?

Genius
Genius

Hello,Question if anyone has used the LB function "ReadFromFile"? My idea is to use this function to read values from a file and store them in a constant, for example as an "Order list" to the robot.

 

Kind Regards

Andreas

6 REPLIES

Re: Process Simulate logic block function, ReadFromFile?

PLM World Member Phenom PLM World Member Phenom
PLM World Member Phenom

hello,

 

i work with these function.

it's works fine.

 

i read from file the automatic sequence number.

 

 

Kind regards,

Benjamin Voelzke

Re: Process Simulate logic block function, ReadFromFile?

Genius
Genius

Hello Benjamin,

 

Do you have any tips on how to use it, what is the requested inputs, where should the file be stored etc.

 

Thank you!

 

Kind Regards

Andreas

Re: Process Simulate logic block function, ReadFromFile?

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

as far as I know, ReadFromFile has 2 arguments:

- the first is the reading trigger. Each time this parameter is changing state (True/false) a new value will be read from the file

- the second argument auto_on should be true.

 

that fuinction returns the next value read from the file.

Extries:

FlipFlop (bool)

Auto_On (Bool)

Exit

Value (Int)

 

Value = ReadFromFile (FlipFlop, Auto_on).

 

The file name should be Test.txt and should be located in the tmp dir in the drive where the data is. it should contain 1 value per line.

 

Best regards

Bernard

 

Re: Process Simulate logic block function, ReadFromFile?

Genius
Genius

Hi Bernard,

 

thank you for a good explanation.

So the function will automatically read from the next line in the file if I understand you correcty.

 

Must be convenient to use a rising edge as reading trigger, for example when station cycle is finished - resulting in a new order being read for each cycle.

 

Again, thanks!!

 

Kind Regards

Andreas

Re: Process Simulate logic block function, ReadFromFile?

Siemens Legend Siemens Legend
Siemens Legend

Hi ANdreas,

 

unfortunately rising edge will not work as expected. a new value us read when changing from False to True and from True to false.

so I created a FlipFlop parameter that changes state at each rising edge of a siganl. That worked fine.

 

Best regards

Bernard

 

Re: Process Simulate logic block function, ReadFromFile?

Genius
Genius

Hi,

 

late reply. I increased the integer each time the cycle finished resulting in reading of the file working as expected.

Thanks for your assistance.