Hi ROOTers,
I’m trying to connect a HP 33120A wave-generator via RS232 to my computer.
I wrote a very simple c program, which works pretty file (see hp33120.c)
when I’m trying to put the content of the program into a C++ class and provide this to root the rs232-io behaves very strange:
The device has problems to interpret the code, so I put a logic analyser to the TX-line and put the output in the attachement. As you can see I tried to write “SYSTEM:REMOTE\n”. In case of the simple c program it works fine, running over CLING with the test-script it generates strange bit-patterns at the beginning (here are two bit which should not be), because of this everything is shifted and the code cannot be interpreted correctly anymore. I tried to make workarounds with usleeps, but its not working.
thanks for this hint to run the c-prog in CLANG… yes this works…
I checked some much older projects I worked on before and found another RS232-class. I copied some lines together and it seems to work - sorry the code is ugly, but it works! I didn’t check the receive function so far, seems I implemented some special cases here in order to allow a line-end which is not the message-end.
I do not understand the difference so far… at the moment I am happy its working.