Simulate AM Scanning

Im having an issue trying to simulate an AM scan

Initialize global AMMin to 540
Initialize global AMMax to 1600
Initialize global AMStep to 10

to printfrequency
do set label1.text to KHz

when screen1.initalize
do call printfrequency

It will print out KHz but no frequencies. So how do I create a loop to simulate this?

Use the clock component

Taifun