Tango7
Member
I am running Excel XP and RSLogix 5000 ver 13 with RSLinx Classic.
I am trying to check if the Variable - EndBag is equal or not equal to 0 (zero). I keep getting a type mismatch when I put in the code below. The type mismatch is at the Val(EndBag). I have also tried it without the Val, and I have tried putting the 0 in quotes.
Any suggestions would be appreciated.
EndBag = DDERequest(RSIchan, "gStop.OGOOD.Carrier.Data.EndOfBag")
If Val(EndBag) = 0 Then
EndBa = "Not"
Else
EndBa = "YES"
Worksheets("Sheet1").Cells(Row, 5).Interior.ColorIndex = 3
End If
I am trying to check if the Variable - EndBag is equal or not equal to 0 (zero). I keep getting a type mismatch when I put in the code below. The type mismatch is at the Val(EndBag). I have also tried it without the Val, and I have tried putting the 0 in quotes.
Any suggestions would be appreciated.
EndBag = DDERequest(RSIchan, "gStop.OGOOD.Carrier.Data.EndOfBag")
If Val(EndBag) = 0 Then
EndBa = "Not"
Else
EndBa = "YES"
Worksheets("Sheet1").Cells(Row, 5).Interior.ColorIndex = 3
End If