Which data type does your square wave signal has? If it is a waveform you can get the value as an array of double with the Get Waveform Components primitve.
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions