| Products > Test Equipment |
| SCPI commands on Siglent scope |
| (1/3) > >> |
| PatrickB:
I am writing software (with Visual Studio C#) for remote control of my SDS1204X-E. I had already made a similar program for my old DS1102Z-E but with much less functions, but it worked Here are a few lines of code in my program, with explanations of their functions: mbSession.RawIO.Write("TRSE EDGE,SR,C1"); // program the trigger on edge of channel 1 mbSession.RawIO.Write("C1:TRSL POS"); // program the trigger on rising edge mbSession.RawIO.Write("SCDP"); // screen dump byte[] aDataScope = mbSession.RawIO.Read(768067); // returns the data of bmp file MemoryStream streamImageReceived = new MemoryStream(aDataScope); PBx_TraceScope.Image = Image.FromStream(streamImageReceived); // display bmp file from scope on my PC screen Each of these instructions (mbSession.RawIO.Write) work if executed separately. But placed one after the other, the "SCDP" instruction does not return the update of the 2 previous lines. The scope screen is updated correctly but not the display on my PC. The solution would be this: mbSession.RawIO.Write("TRSE EDGE,SR,C1"); // trigger on edge of channel 1 mbSession.RawIO.Write("C1:TRSL POS"); // trigger on rising edge Thread. Sleep(500); // 500ms delay mbSession.RawIO.Write("SCDP"); ... I find that this solution is not the best because I am not sure that the delay will be sufficient with another programming of the scope. It may depend on different parameters of the scope such as the speed of the time base, the number of points of forms, ... Of course, a delay of several seconds would be the solution, but I find it annoying to wait for the reaction of a program after having clicked on a button. My explanation would be that the Siglent does not completely <<finish>> SCPI instruction before starting the next one. :-- I hope I have been clear with my explanations and if anyone has already encountered this problem, solved or not, has experience with C#, SCPI Siglent, thank you for your feedback. |
| tv84:
You need to query the SCPI state machine in order to see if the previous SCPI command has already finished. It can be done in a loop and as soon as you get an OK, then you can proceed with the next SCPI command. |
| PatrickB:
That's what I thought at first too. I did a while loop with the command *OPC? ((Operation Complete), but the return is still 1. It doesn't work. |
| colorado.rob:
--- Quote from: PatrickB on May 05, 2023, 04:07:43 pm ---I did a while loop with the command *OPC? ((Operation Complete), but the return is still 1. It doesn't work. --- End quote --- So *OPC? before SCDP returns 1 and the SCDP command fails? That sounds like a bug. Contact Siglent. SiglentNA has been responsive when reporting similar SCPI problems in the past. Hopefully they can provide a work-around while they fix it. |
| tv84:
--- Quote from: PatrickB on May 05, 2023, 04:07:43 pm ---I did a while loop with the command *OPC? ((Operation Complete), but the return is still 1. It doesn't work. --- End quote --- Don't use just OPC. Use the full *ESR? like here. Study the different states where you are successful and not, and you'll see how to do it. |
| Navigation |
| Message Index |
| Next page |