Boolean operations on Variant data type

Tango7

Member
Join Date
Nov 2008
Location
Gainesville, GA
Posts
12
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
 

Similar Topics

Hello, I am new to PLC programming. I have a very basic doubt about STL programming. As per Siemens manual 'Statement List (STL) for S7-300 and...
Replies
1
Views
2,321
Hi. I haven't touched an Allen Bradley PLC for more than 10 years and I'm kind of rusty. I want to do something really simple in a FBD section...
Replies
5
Views
874
All, i nto fully get it. I read trough some froums but not finaly make it running. so I try to ask. Hopefully anybody has the kindness to answers...
Replies
7
Views
1,228
Example: Take this boolean algebraic expression: note: I'm using a single quote to denote negation as I can't place a bar over the letter. (CA +...
Replies
9
Views
2,844
I was just curious if there is a way to search for a description of a boolean contained within a DINT/INT. For instance, I have a DINT[1] named...
Replies
6
Views
2,283
Back
Top Bottom