DAQNoob Posted March 7 Share Posted March 7 (edited) Hi, I thought I could reuse PWM code from a USB-1608G module in the USB-CTR04 but get a ULError "Invalid counter device". Is this expected? I was under the impression that the USB-CTR04 had an internal timebase, like the USB-1608G does for PWM generation on TMR0. If it doesn't, is there example python code to show how to configure the USB-CTR04 for PWM generation on TMR0-3? Update: I was able to configure TMR0 on two USB-CTR04 modules as done on the USB-1608 but TMR1/TMR2 (same config) are not working. I think my issue is in understanding external/internal port/channel mapping. If I am reading the internal channel config correctly: for channel in ctr_info.chan_info: if channel.type == CounterChannelType.CTRPULSE: print(f'CTRPULSE Channel(s): {channel.channel_num}') CTRPULSE Channel(s): 0 CTRPULSE Channel(s): 1 CTRPULSE Channel(s): 2 CTRPULSE Channel(s): 3 map to TMR0-3 Edited March 7 by DAQNoob Additional info... Link to comment Share on other sites More sharing options...
0 Fausto Posted March 7 Share Posted March 7 Hello @DAQNoob. The MCC USB-CTR04 and MCC USB-1608G support PWM with the Timer output subsystem and both are supported by the MCC mcculw Python library and MCC UL for Linux Python API (ULDAQ). https://files.digilent.com/manuals/UL-Linux/python/hwov.html#ctr0x https://files.digilent.com/manuals/UL-Linux/python/hwov.html#usb-1608g-series Supported products list: https://files.digilent.com/manuals/PyWin-hw.pdf https://files.digilent.com/manuals/Linux-hw.pdf UL Help Windows Guide: MCC Universal Library Help Regards, Fausto Link to comment Share on other sites More sharing options...
Question
DAQNoob
Hi,
I thought I could reuse PWM code from a USB-1608G module in the USB-CTR04 but get a ULError "Invalid counter device".
Is this expected? I was under the impression that the USB-CTR04 had an internal timebase, like the USB-1608G does for PWM generation on TMR0.
If it doesn't, is there example python code to show how to configure the USB-CTR04 for PWM generation on TMR0-3?
Update: I was able to configure TMR0 on two USB-CTR04 modules as done on the USB-1608 but TMR1/TMR2 (same config) are not working.
I think my issue is in understanding external/internal port/channel mapping. If I am reading the internal channel config correctly:
for channel in ctr_info.chan_info:
if channel.type == CounterChannelType.CTRPULSE:
print(f'CTRPULSE Channel(s): {channel.channel_num}')
CTRPULSE Channel(s): 0 CTRPULSE Channel(s): 1 CTRPULSE Channel(s): 2 CTRPULSE Channel(s): 3
map to TMR0-3
Edited by DAQNoobAdditional info...
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now