www.homeseer.com    
 

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Plug-ins by Author > Click Here for List of Author Forums > GainTech Solutions Plug-Ins > GTS CPUXA Ocelot Plug-in (3P)

GTS CPUXA Ocelot Plug-in (3P) Discussion of GTS CPUXA Ocelot Plug-in

Reply
 
Thread Tools Display Modes
  #1  
Old June 4th, 2017, 08:21 PM
twinch twinch is offline
Seer
 
Join Date: Jun 2003
Location: West Palm Beach, FL, US
Posts: 56
Analog Input Values

I'm hoping you will put out a version that can read the analog input values. I have temperature sensors on my Secu16 and read them with a script. I had this working since last year in a modified version of the open source by exposing GetAnalogInput. I believe I had to modify something from Int16 to Int32 to prevent errors in the plugin.

I purchased a license since you had done so much work on the plugin. I had figured out the poll thread processor usage issue, gBusy not declared, the send_IR and the analog inputs, but you already had the PED issue worked out and did a lot more with the plugin.

I use a script like this which worked fine.
sub main
dim v
v = hs.PluginFunction("Applied Digital Ocelot", "", "GetAnalogInput", array(2,0))
if v>10 and v<250 then hs.setdevicevalue "T1",round(100*v/256,1)
End sub

The plugin code I'm sure you have looks like this.
Public Function GetAnalogInput(ByRef unit As Short, ByRef point As Short) As Short
'Dim snd(7) As Byte
Dim i As Short
Dim rcv(6) As Byte
Dim buf(256) As Byte
On Error Resume Next
If Not gIOEnabled Then Exit Function
gbusy = 1
SendToCPUXA(FrameGenerator.InitiateGetUnitParameters(point + 10))
WaitForChar(gTimeOut, 3, 0)
Wait(1)
gbusy = 1
SendToCPUXA(FrameGenerator.GetUnitParameters)
If (WaitForChar(gTimeOut, 6 + 256 + 2, 42)) Then
For i = 0 To 5
rcv(i) = rbuffer(i)
Next
For i = 0 To 255
buf(i) = rbuffer(i + 6)
Next
Status = ERR_NONE
Else
If gLogErrors Then
hs.WriteLog(IFACE_OTHER, "Warning, Ocelot Plug-in, Timeout getting analog I/O")
End If
Status = ERR_SEND
End If
gbusy = 0
GetAnalogInput = buf((unit - 1) * 2)
End Function
Reply With Quote
  #2  
Old June 4th, 2017, 09:31 PM
twinch twinch is offline
Seer
 
Join Date: Jun 2003
Location: West Palm Beach, FL, US
Posts: 56
Nevermind - Found the solution

I found the method. it works as well as it did before.

Public Sub ReadInput(ByVal Parms As Object)
Dim v As Int32
Dim plugin = New HomeSeerAPI.PluginAccess(hs, "GTS CPUXA", "")
Dim Parm(1) As Object
Dim Unit As Byte = 2 ' Unit 2
Dim pnum As Byte = 11 'Point 1 (+ 10)
Parm(0) = Unit
Parm(1) = pnum
v = CInt(plugin.PluginFunction("GetParameter", Parm))
If v > 10 And v < 250 Then
hs.SetDeviceValue("T1", Math.Round(100 * v / 256, 1))
hs.WriteLog("Ocelot", Math.Round(100 * v / 256, 1) & " Degrees")
hs.WriteLog("Ocelot", Math.Round(v / 51, 2) & " Volts on input")
End If
End Sub
Reply With Quote
  #3  
Old June 5th, 2017, 07:28 AM
bbowser's Avatar
bbowser bbowser is offline
Seer
 
Join Date: Jan 2016
Location: Canandaigua, NY
Posts: 73
Hello twinch,
Since response times can be long getting unit parameters via RS232, normally I write a CMax program to write analog values to variables. Then monitor the variables with the plugin. Same data, but a more reliable way to get it.

I have Ocelots out in the field set up this way monitoring many different analog signals.

Bruce
Reply With Quote
  #4  
Old June 10th, 2017, 03:58 PM
twinch twinch is offline
Seer
 
Join Date: Jun 2003
Location: West Palm Beach, FL, US
Posts: 56
Using a variable works much better!
Thank you.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Analog input problem Ron Arduino Plugin (3P) 10 October 15th, 2016 06:33 AM
How to read analog input rick SimpleHomeNet Plug-in 17 August 1st, 2015 05:20 PM
Analog input connections deverson1 HomeSeer ADIO-100 Plug-in 1 October 25th, 2011 03:29 PM
Analog input problems mterry63 ADIOcelot 3 June 6th, 2005 08:44 PM
How to Read the Analog Input On SECU16I RobM ADI Ocelot 2 September 6th, 2002 09:45 AM


All times are GMT -4. The time now is 03:08 PM.


Copyright HomeSeer Technologies, LLC