Test and Measurement Forum

32-bit code won't work on 64-bit OS (VB.NET)

Post your .Net discussions here

32-bit code won't work on 64-bit OS (VB.NET)

Postby Edk » Tue Sep 16, 2014 5:59 pm

I've been struggling to work out why this doesn't work properly on a 64 bit OS, I've followed the advice about the target CPU but that didn't help.

I can get it to connect, and run in streaming mode. When I try to use block mode, it triggers OK but never becomes ready for me to collect the data.

I've included the function declarations as comments as I suspect something is wrong there.


Code: Select all
        Dim ok As Short
        Dim time_interval As Integer
        Dim time_units As Short
        Dim max_samples As Integer
        Dim time_ontest As Integer
        Dim timebase As Short = 12
        Dim no_of_values As Short = 7000
        Dim oversample As Short = 18


'Declare Function ps3000_set_channel Lib "ps3000.dll" (ByVal handle As Short, ByVal channel As Short, ByVal enabled As Short, ByVal dc As Short, ByVal range As Short) As Short

        If TestChannel = 0 Then
            ok = ps3000_set_channel(ps_handle, 1, 0, 1, VoltageRange)
        Else
            ok = ps3000_set_channel(ps_handle, 0, 0, 1, VoltageRange)
        End If
        Debug.WriteLine("set_channel: " & ok)

'Declare Function ps3000_get_timebase Lib "ps3000.dll" (ByVal handle As Short, ByVal timebase As Short, ByVal no_of_samples As Integer, ByRef time_interval As Integer, ByRef time_units As Short, ByVal oversample As Short, ByRef max_samples As Integer) As Short


        ok = ps3000_get_timebase(ps_handle, timebase, no_of_values, time_interval, time_units, oversample, max_samples)


'Declare Function ps3000_set_trigger Lib "ps3000.dll" (ByVal handle As Short, ByVal source As Short, ByVal threshold As Short, ByVal direction As Short, ByVal delay As Short, ByVal auto_trigger_ms As Short) As Short

        If ok > 0 Then
            ok = ps3000_set_trigger(ps_handle, TestChannel, test.TriggerLevel, 0, TestDelay, TimeOutms)
           

'Declare Function ps3000_run_block Lib "ps3000.dll" (ByVal handle As Short, ByVal no_of_values As Integer, ByVal timebase As Short, ByVal oversample As Short, ByRef time_indisposed_ms As Integer) As Short


            If chkintegerTest.Checked = True Then
                ok = ps3000_run_block(ps_handle, 7000, 13, 18, time_ontest)
            Else
                ok = ps3000_run_block(ps_handle, 7000, 12, 18, time_ontest)
            End If

'Declare Function ps3000_ready Lib "ps3000.dll" (ByVal handle As Short) As Short

            Dim ready As Short
            Do
                ready = ps3000_ready(ps_handle)
                If ready > 0 Then
                    Exit Do
                End If
            Loop
Edk
User
User
 
Posts: 2
Joined: Tue Jun 14, 2005 1:57 pm

Re: 32-bit code won't work on 64-bit OS (VB.NET)

Postby Hitesh » Thu Sep 18, 2014 8:29 am

Hi Edk,

Your code appears to be fine in terms of data types used in the function declarations.

Please ensure that you are using the latest version of the ps3000.dll (you can find this in the latest PicoScope 6 install directory as the last SDK release was a few months ago).

Please check how you are setting the threshold level for the trigger - what is the values of test.TriggerLevel and VoltageRange? Is your input signal passing through the threshold value?

Does the code work on a 32-bit OS?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 32-bit code won't work on 64-bit OS (VB.NET)

Postby Edk » Thu Sep 18, 2014 11:15 am

Hi Hitesh,

I've just made sure that I have the latest DLL but it hasn't made a difference. I've disabled the trigger and tried it without with the same result, and double checked that the values make sense for the signal that is being received when it is not disabled.

VoltageRange is 8 and triggerlevel is calculated to be just above the baseline before the test begins. I assume the timeout should still work anyway if I don't give it a signal - nothing happens well outside of this timeframe.

Finally I've just double checked that the code works on 32 bit systems.

Ed
Edk
User
User
 
Posts: 2
Joined: Tue Jun 14, 2005 1:57 pm

Re: 32-bit code won't work on 64-bit OS (VB.NET)

Postby Hitesh » Fri Sep 19, 2014 11:28 am

Hi Ed,

Would it be possible to send your project files to support@picotech.com please?

I can try running it here and see if I can reproduce the issue.

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests