iFix 5.0 VB question

mwilliamsiei

Member
Join Date
Nov 2005
Location
Indiana
Posts
14
Why doesn't this work?

Dim Num As Integer
Num = 5
WriteValue Num, "Fix32.SCADA.TEST.F_CV"

The tag is an AI so I am not sure what I am doing wrong. "Num" will be a variable from another tag that is going to be passed from one PLC to an other. I would also take advise on how to write from one tag to another if there is another way to do it. After all that is what I am trying to do.
the error I am getting is:
Compile Error:
ByRef argument type mismatch
 
iFix 5.0 VB question
Why doesn't this work?

Dim Num As Integer
Num = 5
WriteValue Num, "Fix32.SCADA.TEST.F_CV"

The tag is an AI so I am not sure what I am doing wrong. "Num" will be a variable from another tag that is going to be passed from one PLC to an other. I would also take advise on how to write from one tag to another if there is another way to do it. After all that is what I am trying to do.
the error I am getting is:
Compile Error:
ByRef argument type mismatch


I have also just gone through this, am using iFIX for the 1st time in years.

Try Dim Num as String instead, this is what worked for me.

To write the value from 1 tag to another, use the ReadValue of the tag you want to write from,
ie
Num = ReadValue("Fix32.SCADA.TEST_NEW.F_CV")
WriteValue Num, ("Fix32.SCADA.TEST.F_CV")

I am not sure if this will work as it stands, I don't have iFIX with me at the moment. Have a crack and see what you come back with.
 
the writevalue function expects a string, try:

Dim Num As Integer
Num = 5
WriteValue Cstr(Num), "Fix32.SCADA.TEST.F_CV"
 
This is what I do and it seems to work, but it involves a little overhead in terms of variables/objects. What is nice here is that you can now treat your tag as a VBA object. Give it a try and see if it works.

Note this is from Fix 3.5, not sure if 5.0 supports the System.FindObject() function.
_________________________

Private Sub WriteTag_Click() 'or OnChange
Dim strTag As String
Dim ObjTag As Object

'Sets tag as a string variable
strTag = "Fix32.SCADA.TEST.F_CV"

'Finds the object corresponding to your tag name
'in the database, sets it as an object variable
Set ObjTag = System.FindObject(strTag)

'Writes to the object / database tag ObjTag
'points to.
ObjTag.Value = 5
_____________________________________
 
Last edited:
Why doesn't this work?

Dim Num As Integer
Num = 5
WriteValue Num, "Fix32.SCADA.TEST.F_CV"

The tag is an AI so I am not sure what I am doing wrong.
ByRef argument type mismatch


I am sure this is solved by now, but should the tag type not be AO or AR?
I don't think if you can write value to the input tag.
 

Similar Topics

Whats the best way to move iFix from a Server2008R2 machine to windows 10? The hardware is identical on both machines. Both are running iFix5.8...
Replies
5
Views
2,071
I am talking to a Logix 5500 series PLC with ABR driver currently. IFIX Database shows addressing setup like this -...
Replies
4
Views
1,774
I have a line with an AB SLC5/05 and an IFix HMI that was designed poorly. I have the development package, copied the program folder to my XP...
Replies
0
Views
1,711
In the past, we were using old Intellution Fix and we allowed the user to backup historical data by just copying the HTRDATA folder to a disk with...
Replies
0
Views
2,353
Good day all. I have a Versa View 1700P (AB Computer) and I used iFIX software for the HMI. My other Versa View gave up the ghost. I have a new...
Replies
0
Views
1,423
Back
Top Bottom