K8055 Crash

Hi,
I have written a program with visual basic 6 to control the k8055 board. It has two timers: one used to read a value from an analog channel, and one used to make a cycle (using two digital out and one analog out ) for a press wich is connected the board. If I run the program, it works for a variable time (1-10 mins) reading the inputs and driving the outputs then the board blocks, often setting on the output n°8. If I disconnect and riconnect the usb cable, it works again.

I’m desperate, where is the problem?

Thank you

Could you please post your VB6 code here.
Also I need to know the timer interval values.

--------This timer has an interval of 1000 ms-----

Private Sub Timer1_Timer() 'timer gestione ciclo
Timer2.Enabled = False

a = a + 1 'variabile tempo inizio ciclo

If a < tp Then
attesa = True
Stringa_Tempo (a)
If a = 1 Then Accendi_Pompa (pompaGrande) 'sub that sets one digital output
End If

If a > tp Then

attesa = False
If a = (tp + 1) Then Spegni_Pompa (pompaGrande) 'sub that turn off the digital output

s = s + 1 'variabile tempo

If s > t_fin Then
p = 0
s = 0
a = 0
Spegni_Pompa (pompaPiccola)
ClearAllAnalog
ClearAllDigital

             Form1.Caption = "Ciclo Terminato"
             Timer1.Enabled = False             'timer ciclo
             Timer3.Enabled = True              'timer campanello
             
             'MsgBox ("Ciclo terminato")
             
             Command2.Caption = "START"

             attesa = True
             volta = False
             Label3.Caption = "Pressione impostata: " + Str$(p) + " bar"
             Label6.Caption = "Differenza pressione: " & " -- bar"
         Else
             
            Stringa_Tempo (s)                                                       'this make a little calculus for displaying the time
            
            
            p = Round(p_fin + (p0 - p_fin) * 2.718 ^ (-s / k) + s / k)      
            
               
            If p < 0 Then p = 0
            
            comando_p = p + kp * (p - px)
            
            If comando_p < 0 Then comando_p = 0
            
            imposta_pressione (comando_p)               'set the analog output
            
            
            'CONTROLLO PRESSIONE E AVVIO POMPA
            
            If px < (p - soglia_pompa) Then
                                            If volta = False Then Accendi_Pompa (pompaPiccola): Debug.Print "ON", s  
                                            volta = True
                                       Else
                                            If volta = True Then Spegni_Pompa (pompaPiccola): Debug.Print "OFF", s
                                            volta = False
            End If
            
            
            
            Picture1.ForeColor = 0                        'this make a graph
            Picture1.PSet (s, 200 - p)
            Picture1.ForeColor = &HFF00FF
            Picture1.PSet (s, 200 - px)
            
            
            Label3.Caption = "Pressione impostata: " + Str$(p) + " bar"
            Label6.Caption = "Differenza pressione: " & (p - px) & " bar"
            
            ProgressBar1.Value = ((s / t_fin)) * 100

End If
End If

Timer2.Enabled = True
End Sub

--------This timer has an interval of 350 ms-----

Private Sub Timer2_Timer()
'Timer1.Enabled = False

quale = Not quale

If quale = False Then p1 = ReadAnalogChannel(1) * KS
If quale = True Then p2 = ReadAnalogChannel(1) * KS

px = Round((p1 + p2) / 2, 2) 'make the average value

Label4.Caption = “Pressione misurata: " & Str(px) & " bar”

'Timer1.Enabled = True
End Sub

Thank you. I’ll check the code.

The problem may be some sort of collision.
Maybe timer 2 is still doing its tasks when timer 1 event occurs.
Please test with one timer (timer 1) only. Do the problem still exist?

Now timer 1 disables timer 2. There may be problems if timer 2 tasks are still processed.

The problem come without disabling the timer also, and the card blocks also with only one timer running (timer2). The strange thing is that it blocks at variable running time (from 1 to 10 mins). Can be an hardware problem?

If there is a hardware problem it should appear with the demo software too.
Here is the link to download the latest K8055 software package with the new K8055D.DLL:
velleman.eu/downloads/files/ … rsion4.zip
Please run the demo in the folder \demo.
You can also run the demo VB6 project in the \examples\ K8055DemoVB6 folder.
Before running the VB6 demo: Copy the file K8055D.DLL from the folder \DLL_v4.0.0.0 to the \Windows\System32 folder.
In 64-bit environment copy the file to \Windows\SysWOW64 folder.

With the “demo” program it’s the same thing. It runs for few minutes reading analog values, then disconnest the card. At this point I think that is an hardware problem. What I have to check?

Can you test the card in other PC?
Doing this test eliminates possible driver problem as a cause.

Yes, I have tested it on two different pc (on with win 2000 and one with win7 x64) and it’s the same thing

As a final test you may try with other USB cable.

Also with another cable the program will block. Often LD8 flash when the program is blocked. The only way in disconnect and reconnect the usb cable and the program works again.
I have also changed the 6MHz quartz and the 33pF capacitors, but nothing is changed. What we can do?

It seems the kit (maybe the microcontroller IC3) is defective.
You have to send the kit to check / repair.

velleman.eu/distributor/supp … rantykits/