Cross-platform command line program for Koolertron 60MHz DDS Signal Generator - Page 1
Forum section: electronics / projects

author: defcronyke
author_rank: Newbie
timestamp: December 28, 2020, 10:14:07 pm
content: Hey folks. I bought a device called "Koolertron Upgraded 60MHz DDS Signal Generator Counter, High Precision Dual-channel Arbitrary Waveform Function Generator Frequency Meter 200MSa/s (60MHz) Model: GH-CJDS66-FU" on Amazon awhile ago, and I wanted to control it from the command line on Linux, so I emailed Koolertron and they sent me the official English-language usb-serial communication spec document to use to make an unofficial open source program which can control this signal generator.I don't think they'll allow me to share the spec document, however, I used it with permission to make a cross-platform open source command line program which implements nearly every feature from the spec, so if you're interested, you could use the program, or you could study its code to infer the official spec for your own purposes. It's only missing a few extra convenience features listed near the end of the spec document, and only because they didn't seem to work as advertised, and I didn't understand them, but those extra features aren't really important anyway. If anyone can figure those out and explain them to me, I'd be happy to add those features in a future version. Because it's a command line program, you can use it to automate the features of the device easily, and operate it from inside custom scripts you write or however you want.The first version of my program "signal-gen-cjds66" v0.1.0 was just released last night. It can be considered pretty much feature-complete, and it's tested and working on Linux and Windows (maybe it works on Mac too, but I didn't test that). It can be used to control multiple of these devices sequentially in one command invocation, which you might find useful. It probably doesn't work perfectly for every possible use-case, and this version might have a few bugs, so let me know if you tried it and have any questions, or if you notice any issues you want addressed, and I'll consider it.Here's the project, it lives on GitLab:https://gitlab.com/defcronyke/signal-gen-cjds66It's better to file bug reports on GitLab and open pull requests on there if you want me to consider something, but if you prefer, I guess you could mention it on here instead.I'd be interested to know if this program works also with the lower MHz models of this device, or with other similar DDS signal generators. If anyone wants to try it and/or fix it so it works properly on Mac (assuming maybe it doesn't already), that might be cool too.----------UPDATE 2021-01-02- I cleaned up the library's public API a lot, added a bunch of documentation for all the functions, and now I've just published the library portion of this program as a Rust crate here (now at v0.1.3):https://crates.io/crates/signal-gen-cjds66-libThe crate documentation is available here:https://docs.rs/signal-gen-cjds66-lib---UPDATE 2021-01-07- Linux and Windows x86_64 binary builds are now available with each new release from now on, so you don't have to compile from source yourself (now at v0.1.6):https://gitlab.com/defcronyke/signal-gen-cjds66/-/releases

author: ledtester
author_rank: Super Contributor
timestamp: December 29, 2020, 09:48:37 am
content: You might be interested in this python library for FeelTech signal generators:https://github.com/mattwach/fygen/Having a python lib can make interacting with the device a lot simpler and more convenient.Maybe the protocol is very similar to the FeelTech units.Maybe you incorporate your code into the Python lib.Just some ideas...

author: defcronyke
author_rank: Newbie
timestamp: December 29, 2020, 12:09:56 pm
content: Thanks for the link and the suggestion ledtester.I took at look at the python code, and it's very well-written. It's aimed at supporting just Feeltech signal generators though, and the protocol is quite a bit different. I'm not sure it would make much sense to support this device in a Feeltech device support library, and since I already chose to make this program in Rust (most of it is implemented as a Rust library), I'm not really interested in supporting a Python effort for it.It sounds like a project for someone else to do, probably someone who would want to use a Python library also, which I don't have any need for personally. If someone else wants to do it though, I'd be happy to answer any questions they might have while they are trying to implement it.

author: Marcus10110
author_rank: Newbie
timestamp: July 11, 2021, 11:11:52 pm
content: Hi defcronyke, great tool! Thanks for creating it!Quick question - do you see a ~7 second delay after every command? For example,signal-gen-cjds66.exe --output 0,0works just fine, but takes about 7 seconds to complete. Watching in verbose mode suggests that it's just waiting to get an "ok" back from the device.I'm using a slightly different model from the same manufacturer, and besides the delay, your tool is working smoothly!Specifically, I have a "GH-CJDS", seen here:http://www.koolertron.com/koolertron-60mhz-embeddable-dualchannel-signal-generator-counter-24in-screen-display-high-precision-dds-arbitrary-waveform-generator-frequency-meter-266msas-p-835.htmlLastly, thanks again for the tool and for the CI build! Only took a few minutes to get working.

author: defcronyke
author_rank: Newbie
timestamp: July 12, 2021, 12:47:56 am
content: Hey Marcus, thanks, I'm glad someone else finally used it! I thought I was maybe the only one haha.It's great to hear it's working also on this other model. It means maybe it works on other models too, but I only have the one I have so I'm not sure which others it might work for.Oh yeah and you're right, I just tried on the Windows version and the command-line util performs the action immediately but then it hangs for around 7 seconds before exiting the program for some reason. It's only happening on the Windows version and I don't use that so I never noticed. Thanks for pointing it out! Definitely needs to be fixed because that's inappropriate then for scripts, which is the main purpose of this to be able to use it for automation / scripting.I will try to fix it now, and I'll post an update here once it's fixed. You could file an issue about it on GitLab if you want, or if you don't want to that's fine.Thanks again!

author: defcronyke
author_rank: Newbie
timestamp: July 12, 2021, 02:22:48 am
content: Okay, the hang at exit on Windows problem should be fixed in new version: v0.1.10Let me know if you notice a problem. It probably works okay now.