EXCEL WITH MACRO TO RUN SDM3055, SDG1032X AND RD6006P - Page 1
Forum section: electronics / testgear

author: uargo
author_rank: Regular Contributor
timestamp: November 26, 2023, 01:15:48 am
content: Hello, I have been testing an Excel with a macro inside that is capable of managing a Siglent multimeter from the SDM3000 series, a Siglent signal generator from the SDG1000 series (other series may also work) and a Riden RD6006P source.Manage Siglent devices via LAN and the Riden source via USB.It is still in the Alpha phase and whoever uses it should understand that it may still not work completely well.Functions it has:1) It is capable of taking AC and DC measurements indefinitely from the SDM3000 and storing them in Excel itself.2) Choose a maximum intensity and vary the voltage from the source and measure DC voltage and current and store the values in Excel and it will automatically generate a graph. graph (V vs Intensity)2) Choose an rms AC voltage and vary the frequency from the SDG1000 and measure AC voltage and store the values in Excel and it generates a graph automatically. graph (V vs Frequency)allows you to make a basic bode plothttps://drive.google.com/file/d/1QwC-W-pvLDK3XJuieplhsSMR9Ag6pSxP/view?usp=sharingOnce the file is downloaded, go to where the file was downloaded, right click on it, and unlock

author: uargo
author_rank: Regular Contributor
timestamp: November 27, 2023, 08:54:28 am
content: I suppose you all know how to manage the Siglent via SCPI, but for those interested in managing the Riden power supplies, I will tell you that it is done via USB in the RTU MODBUS protocol, that is, (serial MODBUS), and I will add some links to the tables of the addresses etchttps://github.com/Baldanos/rd6006/blob/master/registers.mdexample;Code:Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Dim MSComm As ObjectDim Buffer() As ByteDim a As LongDim tt As LongDim dd As DoubleDim volt As DoubleDim amp As Double' Build Modbus RTU request (write to register 9 set amp)ReDim Buffer(5)Buffer(0) = &H1Buffer(1) = &H6Buffer(2) = &H0Buffer(3) = &H9 'amperage setdd = CDbl(amp) * 10000 'convert the variable amp to double and multiply by 10000, to convert it to Amperestt = ddBuffer(4) = tt \ 256Buffer(5) = tt Mod 256a = enviamodbus(Buffer)'Build the Modbus RTU request (write to register 8 set volt)ReDim Buffer(5)Buffer(0) = &H1Buffer(1) = &H6Buffer(2) = &H0Buffer(3) = &H8 'set voltagedd = CDbl(volt) * 1000 'convert the variable volt to double and multiply by 1000, to convert it to voltstt = ddBuffer(4) = tt \ 256Buffer(5) = tt Mod 256a = enviamodbus(Buffer)'Build Modbus RTU request (write to register 18-12Hex set on/off)ReDim Buffer(5)Buffer(0) = &H1Buffer(1) = &H6Buffer(2) = &H0Buffer(3) = &H12 'set on/offBuffer(4) = &H0Buffer(5) = &H1 '&H1 = on / &H0 = offa = enviamodbus(Buffer)Public Function enviamodbus(data() As Byte) As BooleanDim MSComm As Object'Dim Buffer() As ByteDim i As IntegerDim a As LongDim b, c As ByteDim bufferr As String'Instantiate serial port controlSet MSComm = CreateObject("MSCOMMLib.MSComm.1")' Open the serial port on textbox3 (adjust settings as necessary)MSComm.CommPort = Int(TextBox3.Text)MSComm.Settings = "115200,N,8,1" ' Communication settingsMSComm.InputLen = 0 ' Input length (0 to receive all)' Abrir el puerto serieMSComm.PortOpen = True'Calculate CRC16 (CRC16 checksum)a = CRC16(data)b = a \ 256c = a Mod 256' Add the CRC16 bytes to the bufferReDim Preserve data(UBound(data) + 2)data(UBound(data) - 1) = c ' Bytedata(UBound(data)) = b ' ByteMSComm.Output = databufferr = ""hh = 0Do'Bufferr = Bufferr & MSComm.Inputbufferr = MSComm.Inputhh = hh + 1Sleep (5)DoEventsLoop Until Len(bufferr) > 6 Or hh > 40 '6MSComm.PortOpen = Falseenviamodbus = TrueEnd Function