07-16-2018 05:01 PM
I'm using a USB-7855R with a SCB-68 to handle analog signals.
I'm having trouble finding an example where all of the wire types/data are compatible with this system in the LabVIEW help files. My problem seems like it should have a simple fix.
My goal: Generate a 5 Vpp square wave with a 2.5V offset so the signal goes from 0 to 5V. I'm attempting to use the Square Wave Generator VI. It seems that it will not allow me to put in a decimal number for the amplitude which my understanding is that this is due to the data type; however, I've been running into problems where certain wiring and data types are not compatible with this FPGA system.
Two questions: (1) Can someone help me generate my desired analog output signal? (2) Is there a way to set up my code such that I can control the frequency in units of Hz and have the conversion to periods/tick done for me that is compatible with this FPGA system? Code is attached. Thank you.
Solved! Go to Solution.
07-17-2018 04:21 PM
If you are having trouble with data types, it may be simpler to create your own function for switching between high and low. That way you can specify the outputs manually.
One such way to do so would be having a timing function provide a tick count. You could pick a timing function that provides time defined in a unit such as ms, making defining control in Hz simpler. Given that tick count, you can choose to output a high or low value that you specify with a constant. Depending on your needs, you could design the logic for switching high or low.
07-21-2018 11:54 AM
That helped solve the problem. I used a Loop Timer VI inside of the while loop and set the loop iteration time in terms of ms. Then I used a case structure to do either high or low voltage output based on the loop timing to make a square wave with a period as long as 1 while loop iteration. Thanks for your help!
07-23-2018 12:58 PM
Glad it is up and running, and that I could be of assistance!