VB: Ps2203 cannot start up together with an STC 51 SCM

Post your .Net discussions here
Post Reply
yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

VB: Ps2203 cannot start up together with an STC 51 SCM

Post by yangzhaoshu »

I am using ps2203 together with a STC 51 SCM to build a PWM signal generating system, but ps2203 seems cannot open properly with the SCM. When I am starting it up, but the light was off after a sound of click.
Then I disconnected the SCM and PC, but the situation was not improved. The light of pico was not on and both channels are not able to getting data.
Can you help with this problem?

yangzhaoshu

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by Martyn »

Does the 2203 connect correclty if the STC is not connected to the PC at all ?
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by yangzhaoshu »

Hi, Martyn
yes, actually I have modified the program in PC to control both devices, it seems there are sth wrong with the modifacition, because the original editon program can still works properly to control pico alone, whereas the modified one has failed to control both devices and even to start up the pico alone.

thank you

best regards
yangzhaoshu

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by Martyn »

Can you try connecting both devices to a powered USB hub, it may be that the USB power is dipping causing the 2203 to freeze.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by yangzhaoshu »

I have tried to connect the devices without using USB hub, still make no difference. but it seems when I click the button opening pico, "ps2000_handle" turns to above zero, and also a sound of click comes, without flashing the LED

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by Martyn »

Is the hub powered by an external source ?

If not I believe that what is happening is that on opening the Picoscope the power draw is too much for the USB port.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by yangzhaoshu »

sorry, but I don't it is a power supply problem, becuse I once control both the devices by separeted programs successfully, through a USB hub without external sources, so I think there must be sth wrong with my codes.
I guess the error may occur in the following codes,
here is the codes for open pico

Code: Select all

Public Sub open_unit()
Dim S As String * 10
Dim i As Integer

lstChannelA.Clear

FrmButton.Caption = "Opening PS2000"

ps2000_handle = ps2000_open_unit()
If ps2000_handle > 0 Then
    'lstMessage.Clear
    FrmButton.Caption = "PS2000 opened"
    
    i = ps2000_set_ets(ps2000_handle, 0, 0, 0)
    Call Channel_select_Click

Else
       FrmButton.Caption = "Unable to open"
End If


End Sub
here is the codes for communicaton between SCM and PC

Code: Select all

Private Sub MSComm1_OnComm()
    Dim BytReceived() As Byte
    Dim strBuff As String
    Dim i As Integer
    Select Case MSComm1.CommEvent   
        Case 2
            'Cls
            
            MSComm1.InputLen = 0     'load the buffer
            strBuff = MSComm1.Input  'output to buffer
               End Select
End Sub
here is the code for load the form

Code: Select all

Private Sub Form_Load()

If MSComm1.PortOpen = True Then
   MSComm1.PortOpen = False
Else
End If

Combo4.AddItem "COM1"
Combo4.AddItem "COM2"
Combo4.AddItem "COM3"
Combo4.AddItem "COM4"
Combo4.AddItem "COM5"
Combo4.AddItem "COM6"
Combo4.AddItem "COM7"
Combo4.AddItem "COM8"
Combo4.AddItem "COM9"
Combo4.AddItem "COM10"
Combo4.AddItem "COM11"
Combo4.AddItem "COM12"
Combo4.AddItem "COM13"
Combo4.AddItem "COM14"
Combo4.AddItem "COM15"
Combo4.AddItem "COM16"
Combo4.ListIndex = 0


MSComm1.CommPort = Combo4.ListIndex + 1
MSComm1.Settings = "9600,n,8,1"
   'Command5.Caption = "打开串口"
   Shape1.FillColor = &HFFFFC0

Form1.WindowState = 2
voltage_range(0) = 100
voltage_range(1) = 200
voltage_range(2) = 500
voltage_range(3) = 1000
voltage_range(4) = 2000
voltage_range(5) = 5000
voltage_range(6) = 10000
voltage_range(7) = 20000

'Channel
cboVoltageA.AddItem "100mV", 0
cboVoltageA.AddItem "200mV", 1
cboVoltageA.AddItem "500mV", 2
cboVoltageA.AddItem "1V", 3
cboVoltageA.AddItem "2V", 4
cboVoltageA.AddItem "5V", 5
cboVoltageA.AddItem "10V", 6
cboVoltageA.AddItem "20V", 7
cboVoltageA.ListIndex = 7

cboVoltageB.AddItem "100mV", 0
cboVoltageB.AddItem "200mV", 1
cboVoltageB.AddItem "500mV", 2
cboVoltageB.AddItem "1V", 3
cboVoltageB.AddItem "2V", 4
cboVoltageB.AddItem "5V", 5
cboVoltageB.AddItem "10V", 6
cboVoltageB.AddItem "20V", 7
cboVoltageB.ListIndex = 7
Channel_Select.AddItem "A"
Channel_Select.AddItem "B"
Channel_Select.AddItem "A+B"
Channel_Select.AddItem "B+A"
Channel_Select.ListIndex = 2
xyCurve = False
yxCurve = False
streaming = False
stopfast1 = False
Timer1.enabled = False
Timer2.enabled = False
MeasureChannelA = False
MeasureChannelB = False
measureA.Visible = False
measureB.Visible = False
Timed_Measurement = False
longData = False
Line1.Visible = False
Line2.Visible = False
info1(0).enabled = False
info1(1).enabled = False
info1(0).Visible = False
info1(1).Visible = False
info1(2).Visible = False
Line1B.Visible = False
Line2B.Visible = False
info2(0).enabled = False
info2(1).enabled = False
info2(0).Visible = False
info2(1).Visible = False
info2(2).Visible = False
RatioX = 1: RatioY = 1
FrmRight1.enabled = False
FrmRight2.enabled = False

Open "parameters.txt" For Input As #1
Dim a1 As String, b1 As String, c1 As String, d1 As String
Dim i As Integer, j As Integer
i = 0
j = 0
Line Input #1, a1
Do
If Not (EOF(1)) Then Input #1, a1
Select Case a1
  Case "X"
     Input #1, b1, c1, d1
     cboX.AddItem b1, i
     'xParameter(i).axis = a1
     xParameter(i).name = b1
     xParameter(i).unit = c1
     xParameter(i).ratio = Val(d1)
     i = i + 1
  Case "Y"
     Input #1, b1, c1, d1
     cboY.AddItem b1, j
     yParameter(j).axis = a1
     yParameter(j).name = b1
     yParameter(j).unit = c1
     yParameter(j).ratio = Val(d1)
     j = j + 1
  Case "End"
  Close #1
  cboX.ListIndex = 0
  cboY.ListIndex = 3
  

  Exit Sub
End Select

Loop Until EOF(1)
Close #1

End Sub
For fear of not pointing out the error, I would be more than happy to email you the whole source code of my program if it is in need.
yangzhaoshu

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by Martyn »

Please send the full code to support@picotech.com and will take a look.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB: Ps2203 cannot start up together with an STC 51 SCM

Post by yangzhaoshu »

the codes is sent,
Thanks for your enduring help.

Post Reply