I am updating an old app written in API1 (Xojo 2019r1.1) that controls a programmable power source using GPIB. I wrote the app originally for 120 VAC meters with a provision to also handle 277 VAC. At the time, I could control the power supply from the debugger, but we didn’t have 277 volt meters to calibrate. Now that we do, I can set 277 volts and calibrate the meter, but when complete, the power source crashes when I turn off the voltage. After making some changes to the code, I find that any time I send a query or command to the power source, both the power source and the Xojo app hang and have to be reset. After pulling whats left of my hair out for two days (even running earlier versions of the app that used to work, but no longer do), I compiled the latest version and ran it. At least then app and the power supply talk to each other, but the original problem still exists.
I am looking for suggestions to (1) get the app to run in the debugger without hanging everything or (2) come up with a way to log what is happening so I can resolve the problem. I haven’t done any logging like this since using CB86 back in the 1990s. (The power source has three voltage ranges and I think my problem is trying to change range and voltage from one range to the other).
DerkJ
How does it communicate with your device?
Does it use .Flush?
The app runs under Windows and uses a Keysight 82357B USB/GPIB interface and declares to the SICL32.dll. I have not used the iFlush command (which the docs indicate is mostly for formatted data). I do use add Chr(10) to the end of most commands which is supposed to flush the write buffer.
Um, no. Bytes is bytes. Chr(10) has no special meaning to the write buffer. It may have meaning to the specific device, but it doesn’t affect communications.
around your code to track where it is and what it’s doing. When debugging, the log entries can be shown in the IDE by clicking the icon. The compiled app writes debuglog entries to some system log file but I can never remember where it is, others here can tell you.
I think flushing is the answer. Looking at the routine to write to the GPIB port, I saw where I had commented out “+ Chr(10)”, most likely because I did not remember that it means flush in the sicl32 dll. I’ll check it out Monday morning when I can get back in the office. Thanks everyone for your help with this.