Close

Version 4.1 Posted

A project log for GPIB Instrument Control Console

Silly simple GPIB console for U/Linux & Mac OS

brian-cornellBrian Cornell 09/25/2019 at 18:330 Comments

I've been moving off of OS X to Ubuntu (18.04) and ran into problems when trying to compile v4.0.  Some of the string functions used are specific to *BSD systems so LIBBSD is required.  I added a compile pragma to test for Linux to set the correct include paths.  Make sure you have the headers installed (LIBBSD-DEV).

I also ran into a problem with stream reads.  When reading a response from the GPIB device (Prologix USB adapter) an extra line feed exists.  Example:  <string><LF><LF>.  This didn't happen on BSD platforms.  So display fields would be blank or have the wrong data.

Not sure what is doing this or if there's a setting to correct?  Ideas welcome.

The workaround during a read is to ignore a null (LF only) string.  Using the above example the behavior is now:  read string to LF, process & return, leaving second LF in stream (unread).  On next read call the LF is consumed & ignored, and reading continues until a non-null string is read or timeout value is reached.  This seams to work well and shouldn't have any adverse consequences except in situations where a null (LF only) return is expected.  So far I haven't run into this with my gear.

Discussions