Forum Replies Created

Viewing 15 posts - 1 through 15 (of 61 total)
  • Author
    Posts
  • in reply to: Character Set #9730
    ZeRider
    Participant

      I don’t know if that could help, but Ohm symbol is possible in Graphic mode

            ! Initialize Graphic mode
             ! Change Character Set to "Symbol"
             ! Display Ohm sybol ("W" letter)
             !
             GCLEAR
             GFONT IS "Symbol"
             MOVE 10,50
             LABEL "W"
             !
             END
      in reply to: Daqmx for htb #9673
      ZeRider
      Participant

        You can also write the functions you need yourself using NIDAQ32.dll directly, but this will probably take you a lot of time…
        The command descriptions are here : NI DAQ dll commands

        in reply to: Resetting HTBasic and NI-VISA to start up conditions #9417
        ZeRider
        Participant

          Hi Tony,
          First thing to do is to modify the NI Driver call in your software, normally in the “AUTOST” program
          LOAD BIN “GPIBNI;DEV GPIB0 ISC 7”
          “GPIB0” and “ISC7” need to be compatible with what you have in your NIMAX parameters

          in reply to: unexpected error 7 “undefined Function or Subprogram” #9415
          ZeRider
          Participant

            Hi Paolo,
            “htb8dde.csb” is a tool from the MS Office interface

            The best way may be to ask them directly why you are encountering this unexpected error

            in reply to: New Version HTBasic 21.1.016 #9337
            ZeRider
            Participant

              I’m interested, what’s new or updated ?

              in reply to: HTBDDE dll #9282
              ZeRider
              Participant

                Hi all,
                Thanks for the link. I downloaded the last HTBasic version 21.1.015 and the results are indeed differents.
                With this new HTB version the program don’t stop now before the end but from L64C64 cell, the reading in the EXCEL file are always empty (Return$=””)
                Very mysterious …

                in reply to: HTBDDE dll #9280
                ZeRider
                Participant

                  Hi Ralph,
                  please could share me the link where I can download the latest HTBasic version ?

                  in reply to: HTBDDE dll #9278
                  ZeRider
                  Participant

                    Thanks PatB for your Tips.
                    The code display is beautiful now 🙂

                    in reply to: HTBDDE dll #9277
                    ZeRider
                    Participant

                      Hi PatB,
                      my test results with HTBasic 2021 are not better. The program stops and closes without an error message. According to my displays this happens while it tries to read the values on line 64 but the column seems more random…
                      Well anyway, I’m going to use the alternative method recommended by Ralph which works whatever the HTBasic version.
                      I put here my code using EXCEL reading which is defective

                            CONFIGURE LONGFILENAMES ON
                            DLL UNLOAD ALL
                            OPTION BASE 1
                            !
                            CLEAR SCREEN
                            KEY LABELS OFF
                            !
                            DIM C$[200]
                            DIM Return$[50]
                            DIM Data$(1:200,1:259)[20]
                            DIM Disque1$[80],Disque2$[80],Disque3$[80]
                            DIM Htb_version$[80]
                            !
                            LONG Hconvexcel! Excel conversation handle
                            LONG Retval    ! Return value for the DLL functions
                            !
                            !------------------------------------------------
                            ! Computers configuration
                            !------------------------------------------------
                            Htb_version$=SYSTEM$("VERSION:HTB")
                            Htb_version$=TRIM$(Htb_version$)
                            !
                            SELECT Htb_version$
                            !
                            CASE "Windows Release 10.0.3"
                                 Disque1$="C:\Program Files (x86)\HTBwin10\DLL Toolkit\Samples\HTBDde"   ! 22/01/2009 13:32 => Runtime Error : L64C32 (16379)
                                 Disque2$="C:\Program Files (x86)\Microsoft Office\root\Office16"        ! EXCEL 2010
                                 Disque3$="C:\HP_progs\Progs"
                                 !
                            CASE "Windows Release 10.1.3"
                                 Disque1$="C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde"! 22/01/2009 13:32 => Runtime Error : L64C32
                                !Disque1$="C:\Program Files (x86)\HTBasic 2021\DLL Toolkit\Samples\HTBDde"   ! 14/11/2020 09:44 => Runtime Error : L64C32
                                 Disque2$="C:\Program Files (x86)\Microsoft Office\root\Office16"        ! EXCEL 2010
                                 Disque3$="C:\HP_progs\Progs"
                                 !
                            CASE "Windows Release 21.1.009"
                                 Disque1$="C:\Program Files (x86)\HTBasic 2021\DLL Toolkit\Samples\HTBDde"! 14/11/2020 09:44 => HTBasic Close : L64C...
                                !Disque1$="C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde"    ! 22/01/2009 13:32 => HTBasic Close : L64C...
                                 Disque2$="C:\Program Files (x86)\Microsoft Office\root\Office16"        ! EXCEL 2010
                                 Disque3$="C:\HP_progs\Progs"
                                 !
                            END SELECT
                            !
                            PRINT Htb_version$
                            PRINT Disque1$
                            PRINT Disque2$
                            PRINT Disque3$
                            PRINT
                            !
                            !------------------------------------------------
                            ! HTBDDE dll
                            !------------------------------------------------
                            MASS STORAGE IS Disque1$  ! Go to DDE Directory
                            !
                            DLL LOAD "HTBDDE"
                            DLL GET "LONG HTBDDE:Ddeconnect"
                            DLL GET "SHORT HTBDDE:Ddeterminate"
                            DLL GET "LONG HTBDDE:Ddetimeout"
                            DLL GET "SHORT HTBDDE:Ddeexecute"
                            DLL GET "SHORT HTBDDE:Ddepoke"
                            DLL GET "CHARPTR HTBDDE:Dderequest"
                            DLL GET "SHORT HTBDDE:Runexe"
                            !
                            MASS STORAGE IS Disque3$  ! Return to my Directory
                            !
                            LIST DLL
                            !
                            !-------------------------------------------
                            ! Connect to the EXCEL System topic
                            !-------------------------------------------
                            Hconvexcel=0
                            Hconvexcel=FNDdeconnect("Excel","System")
                            !
                            IF Hconvexcel=0 THEN
                               !
                               ! If we couldn't connect, lauch EXCEL and try again
                               !
                               C$=Disque2$&"\Excel.exe"
                               C$=TRIM$(C$)
                               !
                               Retval=0
                               Retval=FNRunexe(C$,1)
                               !
                               PAUSE      ! Very long !!! I prefer to WAIT and [CONTINUE] manually
                               !              ! when EXCEL is open
                               !
                               Hconvexcel=0
                               WHILE Hconvexcel=0
                                     Hconvexcel=FNDdeconnect("Excel","System")
                                     WAIT .1
                               END WHILE
                               !
                            ELSE
                               !
                               GOTO Exit
                               !
                            END IF
                            !
                            !-------------------------------------------
                            ! OPEN selected workbook in DDE Directory
                            !-------------------------------------------
                            Fich$="sample.xlsx"
                            !
                            C$=Disque1$&"\"&Fich$
                            C$="[OPEN("""&C$&""")]"
                            C$=TRIM$(C$)
                            !
                            Retval=0
                            Retval=FNDdeexecute(Hconvexcel,C$)
                            !
                            !--------------------------------------------
                            ! Connexion on the selected Sheet
                            !--------------------------------------------
                            Hconvexcel=0
                            Hconvexcel=FNDdeconnect("Excel","Sheet1")
                            !
                            !--------------------------------------------
                            ! Read EXCEL Datas
                            !--------------------------------------------
                            ! => Error after 16379 read (L64C62) ???
                            !--------------------------------------------
                            Row$="L"
                            Line_max=200
                            Column_max=259
                            !
                            Total=0
                            FOR Line=1 TO Line_max
                                FOR Column=1 TO Column_max
                                    !
                                    C$=""
                                    C$=Row$&VAL$(Line)&"C"&VAL$(Column)
                                    C$=TRIM$(C$)
                                    Return$=""
                                    Return$=FNDderequest$(Hconvexcel,C$)
                                    !
                                    Total=Total+1
                                    Data$(Line,Column)=Return$
                                    PRINT Total,C$,Data$(Line,Column)
                                    !
                                   !C$="[SELECT("""&C$&""")]"
                                   !C$=TRIM$(C$)
                                   !Retval=0
                                   !Retval=FNDdeexecute(Hconvexcel,C$)
                                    !
                                NEXT Column
                            NEXT Line
                            !
                            !
                                 !--------------------------------------------
                                 ! Terminate the connection with EXCEL
                                 !--------------------------------------------
                       Exit:     IF Hconvexcel=1 THEN
                                    Retval=0
                                    Retval=FNDdeterminate(Hconvexcel)! Terminate EXCEL DDE conversation
                                 END IF
                                 !
                                 DLL UNLOAD "HTBDDE"                ! Unload DDE dll
                                 PRINT "Finished"
                                 KEY LABELS ON
                            !
                            END
                      in reply to: HTBDDE dll #9275
                      ZeRider
                      Participant

                        Hi Ralph,
                        Thanks a lot for your alternative method. That’s a really good idea that I hadn’t thought of 🙂
                        Please find below my new code applied …
                        I note your proposal for the HTBasic 2021 test, I will send you an email very soon
                        Regards,
                        LTK

                        PS:
                        I confirm it’s not easy to paste HTBasic code in the forum.
                        I’m very curious to know how PatB managed to keep his indentation in his message !

                        CONFIGURE LONGFILENAMES ON
                        DLL UNLOAD ALL
                        CLEAR SCREEN
                        KEY LABELS OFF
                        !
                        DIM C$[200]
                        DIM Data$(1:200,1:259)[20]
                        DIM Disque1$[80],Disque2$[80],Disque3$[80]
                        !
                        Nb1=259*20 ! Nb of values / Lines
                        Nb2=259-1 ! Nb of separator
                        Nb3=2 ! Line Terminator [CR]
                        Nb=Nb1+Nb2+Nb3
                        !
                        ALLOCATE Lines$(200)[Nb]
                        !
                        LONG Hconvexcel! Excel conversation handle
                        LONG Retval ! Return value for the DLL functions
                        !
                        Pc=1 ! Computer choice
                        !
                        !————————————————
                        ! Computers configuration
                        !————————————————
                        SELECT Pc
                        CASE 1 ! HTBasic 10.1
                        Disque1$=”C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde”! 22/01/2009 13:32
                        !Disque1$=”C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde” ! 14/11/2020 08:44
                        Disque2$=”C:\Program Files (x86)\Microsoft Office\root\Office16″ ! EXCEL 2010
                        Disque3$=”C:\HP_progs\Progs”
                        CASE 2 ! HTBasic 10.0
                        Disque1$=”C:\Program Files (x86)\HTBwin10\DLL Toolkit\Samples\HTBDde” ! 22/01/2009 13:32
                        Disque2$=”C:\Program Files (x86)\Microsoft Office\Office14″ ! EXCEL 2010
                        Disque3$=”C:\HP_progs\Progs”
                        END SELECT
                        !
                        !————————————————
                        ! HTBDDE dll
                        !————————————————
                        MASS STORAGE IS Disque1$ ! Go to DDE Directory
                        !
                        DLL LOAD “HTBDDE”
                        DLL GET “LONG HTBDDE:Ddeconnect”
                        DLL GET “SHORT HTBDDE:Ddeterminate”
                        DLL GET “LONG HTBDDE:Ddetimeout”
                        DLL GET “SHORT HTBDDE:Ddeexecute”
                        DLL GET “SHORT HTBDDE:Ddepoke”
                        DLL GET “CHARPTR HTBDDE:Dderequest”
                        DLL GET “SHORT HTBDDE:Runexe”
                        !
                        MASS STORAGE IS Disque3$ ! Return to my Directory
                        !
                        !——————————————-
                        ! Connect to the EXCEL System topic
                        !——————————————-
                        Hconvexcel=0
                        Hconvexcel=FNDdeconnect(“Excel”,”System”)
                        !
                        IF Hconvexcel=0 THEN
                        !
                        ! If we couldn’t connect, lauch EXCEL and try again
                        !
                        C$=Disque2$&”\Excel.exe”
                        C$=TRIM$(C$)
                        !
                        Retval=0
                        Retval=FNRunexe(C$,1)
                        !
                        PAUSE ! Sometime Very long !!! For the moment I prefer to WAIT and [CONTINUE] manually
                        ! ! when EXCEL is open, I will work on it with Taskmanager …
                        !
                        Hconvexcel=0
                        WHILE Hconvexcel=0
                        Hconvexcel=FNDdeconnect(“Excel”,”System”)
                        WAIT .1
                        END WHILE
                        !
                        ELSE
                        !
                        GOTO Exit
                        !
                        END IF
                        !
                        !——————————————-
                        ! OPEN selected workbook in DDE Directory
                        !——————————————-
                        Fich$=”sample.xlsx”
                        !
                        C$=Disque1$&”\”&Fich$
                        C$=”[OPEN(“””&C$&”””)]”
                        C$=TRIM$(C$)
                        !
                        Retval=0
                        Retval=FNDdeexecute(Hconvexcel,C$)
                        WAIT 1
                        !
                        !——————————————-
                        ! PURGE csv File if existing …
                        !——————————————-
                        Fich$=Fich$[1,POS(Fich$,”.xlsx”)-1]&”.csv”
                        Fich$=Disque1$&”\”&Fich$
                        !
                        ON ERROR GOSUB Err
                        PURGE Fich$
                        OFF ERROR
                        WAIT 1
                        !
                        !——————————————-
                        ! SAVE AS csv
                        !——————————————-
                        C$=”[Save.As(“””&Fich$&”””,23)]” ! 23 is the file type for csv
                        C$=TRIM$(C$)
                        !
                        Retval=0
                        Retval=FNDdeexecute(Hconvexcel,C$)
                        WAIT 1
                        !
                        !——————————————-
                        ! CLOSE EXCEL Activ File
                        !——————————————-
                        Retval=0
                        Retval=FNDdeexecute(Hconvexcel,”[File.Close(0)]”)
                        WAIT 1
                        !
                        !——————————————-
                        ! READ csv File with HTBasic
                        !——————————————-
                        ASSIGN @Samples TO Fich$;FORMAT ON
                        FOR Row=1 TO 200
                        ENTER @Samples;Lines$(Row)
                        NEXT Row
                        ASSIGN @Samples TO *
                        !
                        Total=0
                        !
                        FOR Row=1 TO 200
                        !
                        GOSUB Split ! get comma delimited data from Lines
                        !
                        FOR Column=1 TO 259
                        Total=Total+1
                        PRINT Total,Row,Column,Data$(Row,Column)
                        NEXT Column
                        !
                        NEXT Row
                        !
                        PRINT “Total =”;Total
                        GOTO Exit
                        !
                        !
                        !———————————————
                        Err: ! ERROR management
                        !———————————————
                        ERROR RETURN
                        !
                        !
                        !———————————————
                        Split: ! Extract delimited values from string
                        !———————————————
                        IF POS(Lines$(Row),”,”) THEN C$=”,”
                        IF POS(Lines$(Row),”;”) THEN C$=”;”
                        !
                        J$=””
                        Column=1
                        FOR I=1 TO LEN(Lines$(Row))
                        IF Lines$(Row)[I,I]<>C$ THEN
                        J$=J$&Lines$(Row)[I,I]
                        ELSE
                        Position=I
                        Data$(Row,Column)=J$
                        J$=””
                        Column=Column+1
                        END IF
                        NEXT I
                        Data$(Row,Column)=Lines$(Row)[Position+1,LEN(Lines$(Row))]
                        RETURN
                        !
                        !
                        !——————————————–
                        ! Terminate the connection with EXCEL
                        !——————————————–
                        Exit: IF Hconvexcel=1 THEN
                        Retval=0
                        Retval=FNDdeterminate(Hconvexcel)! Terminate EXCEL DDE conversation
                        END IF
                        !
                        DLL UNLOAD “HTBDDE” ! Unload DDE dll
                        KEY LABELS ON
                        !
                        END

                        in reply to: HTBDDE dll #9269
                        ZeRider
                        Participant

                          Hi PatB,
                          Thanks for help and test.
                          I made some modifications in my code according to yours (please find below my complete updated code)
                          Unfortunatly after a lot of tests on different computers, 2 different EXCEL version, 2 different HTBDDE.dll version, different EXCEL files (including one completely blank EXCEL file) I always have the same error.
                          My maximum number of read is 16379 (L64C62) …!!!
                          Please could re-test my last code on your computer and verify on your side ?
                          Thanks again
                          Regards,
                          ZeRider

                          CONFIGURE LONGFILENAMES ON
                          !
                          DLL UNLOAD ALL
                          !
                          DIM C$[200]
                          DIM Return$[50]
                          DIM Disque1$[80],Disque2$[80],Disque3$[80]
                          DIM Data$(1:200,1:259)[20]
                          !
                          LONG Hconvexcel! Excel conversation handle
                          LONG Retval ! Return value for the DLL functions
                          !
                          Pc=1 ! Computer choice
                          !
                          !————————————————
                          ! Computers configuration
                          !————————————————
                          SELECT Pc
                          CASE 1 ! HTBasic 10.1
                          Disque1$=”C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde”! 22/01/2009 13:32
                          !Disque1$=”C:\Program Files (x86)\HTBwin 10.1\DLL Toolkit\Samples\HTBDde”! 14/11/2020 08:44
                          Disque2$=”C:\Program Files (x86)\Microsoft Office\root\Office16″ ! EXCEL 2010
                          Disque3$=”C:\HP_progs\Progs”
                          CASE 2 ! HTBasic 10.0
                          Disque1$=”C:\Program Files (x86)\HTBwin10\DLL Toolkit\Samples\HTBDde” ! 22/01/2009 13:32
                          Disque2$=”C:\Program Files (x86)\Microsoft Office\Office14″ ! EXCEL 2010
                          Disque3$=”C:\HP_progs\Progs”
                          END SELECT
                          !
                          !————————————————
                          ! HTBDDE dll
                          !————————————————
                          MASS STORAGE IS Disque1$ ! Go to DDE Directory
                          !
                          DLL LOAD “HTBDDE”
                          DLL GET “LONG HTBDDE:Ddeconnect”
                          DLL GET “SHORT HTBDDE:Ddeterminate”
                          DLL GET “LONG HTBDDE:Ddetimeout”
                          DLL GET “SHORT HTBDDE:Ddeexecute”
                          DLL GET “SHORT HTBDDE:Ddepoke”
                          DLL GET “CHARPTR HTBDDE:Dderequest”
                          DLL GET “SHORT HTBDDE:Runexe”
                          !
                          MASS STORAGE IS Disque3$ ! Return to my Directory
                          !
                          !——————————————-
                          ! Connect to the EXCEL System topic
                          !——————————————-
                          Hconvexcel=0
                          Hconvexcel=FNDdeconnect(“Excel”,”System”)
                          !
                          IF Hconvexcel=0 THEN
                          !
                          ! If we couldn’t connect, lauch EXCEL and try again
                          !
                          C$=Disque2$&”\Excel.exe”
                          C$=TRIM$(C$)
                          !
                          Retval=0
                          Retval=FNRunexe(C$,1)
                          !
                          PAUSE ! Very long !!! I prefer to WAIT and [CONTINUE] manually
                          ! ! when EXCEL is open
                          !
                          Hconvexcel=0
                          WHILE Hconvexcel=0
                          Hconvexcel=FNDdeconnect(“Excel”,”System”)
                          WAIT .1
                          END WHILE
                          !
                          ELSE
                          !
                          GOTO Exit
                          !
                          END IF
                          !
                          !——————————————-
                          ! OPEN selected workbook in DDE Directory
                          !——————————————-
                          Fich$=”sample.xlsx”
                          !
                          C$=Disque1$&”\”&Fich$
                          C$=”[OPEN(“””&C$&”””)]”
                          C$=TRIM$(C$)
                          !
                          Retval=0
                          Retval=FNDdeexecute(Hconvexcel,C$)
                          !
                          !——————————————–
                          ! Connexion on the selected Sheet
                          !——————————————–
                          Hconvexcel=FNDdeconnect(“Excel”,”Sheet1″)
                          !
                          !——————————————–
                          ! Read EXCEL Datas
                          !——————————————–
                          Row$=”L”
                          Line_max=200
                          Column_max=259
                          !
                          Total=0
                          FOR Line=1 TO Line_max
                          FOR Column=1 TO Column_max
                          !
                          C$=””
                          C$=Row$&VAL$(Line)&”C”&VAL$(Column)
                          C$=TRIM$(C$)
                          Return$=””
                          Return$=FNDderequest$(Hconvexcel,C$)
                          !
                          Total=Total+1
                          Data$(Line,Column)=Return$
                          PRINT Total,C$,Data$(Line,Column)
                          !
                          !C$=”[SELECT(“””&C$&”””)]”
                          !C$=TRIM$(C$)
                          !Retval=0
                          !Retval=FNDdeexecute(Hconvexcel,C$)
                          !
                          NEXT Column
                          NEXT Line
                          !
                          PRINT “Finished”
                          !
                          !——————————————–
                          ! Terminate the connection with EXCEL
                          !——————————————–
                          Exit: IF Hconvexcel=1 THEN
                          Retval=0
                          Retval=FNDdeterminate(Hconvexcel)! Terminate EXCEL DDE conversation
                          END IF
                          !
                          DLL UNLOAD “HTBDDE” ! Unload DDE dll
                          !
                          END

                          in reply to: HPBASIC 8.3 file conversion issue #9265
                          ZeRider
                          Participant

                            Do you have made the configuration of the WIN-PRNT print driver in the HTBasic Device Setup ?

                            in reply to: NI GPIB-USB-HS+ interface #9233
                            ZeRider
                            Participant

                              I found out why it didn’t work.
                              The “primary address” of the NI interface was not initialized to 7.
                              Fixed by changing configuration with NI-MAX

                              in reply to: NI GPIB-USB-HS+ interface #9232
                              ZeRider
                              Participant

                                I confirme it’s possible to use NI interface (GPIBNI driver) with KEYSIGHT instruments
                                I used these configuration many time in the past but I will try to install KEYSIGHT VISA as Secondary and re-test …
                                I keep you inform

                                in reply to: NI GPIB-USB-HS+ interface #9228
                                ZeRider
                                Participant

                                  Hi Ralph,
                                  I have HTBasic rev 21. Now there is an automatic search when you try to add a new device but nothing is found at the end of the procedure …
                                  I tried to add manually the GPIBNI driver (gpib0) , but when I try the classic Idn? on my instrument (Keysight Analyzer) I have the error “Interface not present”
                                  I can’t add manually the USBS driver because the Agilent I/O libraries aren’t installed

                                Viewing 15 posts - 1 through 15 (of 61 total)
                                Scroll to Top
                                HTB icon

                                Please Sign In