Replaced DS9097U and now script fails!

Jimboat

Member
Can anyone help?

I am having trouble with the script that gets my temperature readings from my 1-wire network. everything has run flawlessly for over 2 years, until my DS9097U failed and i replaced it. The new adapter reads the temps fine using the Dallas TMEX i-Button Viewer, but the HS script now fails! I am running vbs with HS 1.7 inw WinXP (not in .net).

I am using the using Dallas Semiconductor DS9097U COM port adapter and DS18S20 Temperature Sensors. I have loaded 1-Wire drivers version 3.2 and SDK version 4 (tm320b_32.exe). These all worked fine with my previous setup and I have not changed them for the new setup with the replacement DS9097U.

The only difference that i can see is that the old DS9097U-S09 and new one provided by Hobby Boards is DS9097U-009. I don't know what the difference is, or if there even is a difference.

The error that i am getting is:

8/11/2008 6:47:16 PM~!~Error~!~Script error in file: get_temps.txt: 7:Out of memory: 'CreateObject' in line 63

line 63 is...

Set access = CreateObject("owapi.OneWireAccessProvider")

in code below...

'*********************************************************** ******************
' get_temps.txt
'*********************************************************** ******************
' define public variables
Public currentTemp
Public owAddress
sub main()
'*********************************************************** ******************
' main subroutine
'*********************************************************** ******************
Call GetTemps()
end sub
sub GetTemps()
'*********************************************************** ******************
' Get temperatures and assign to virtual devices
'*********************************************************** ******************
Dim access
Dim adapter
Dim i
Dim owd_enum
Dim owd
Dim deviceState
Dim deviceName
Dim CRLF
dim set_date
' make control line feed
CRLF = Chr(13) & Chr(10)
' get the 1-Wire access provider
Set access = CreateObject("owapi.OneWireAccessProvider")
' get the default adapter
'Set adapter = access.getDefaultAdapter()
Set adapter = access.getAdapter("{DS9097U}", "COM9")
hs.WriteLog "Debug", "Adapter: " & adapter.getAdapterName & " Port: " & adapter.getPortName
adapter.beginExclusive(true)
' clear any previous search restrictions
adapter.setSearchAllDevices()
adapter.targetAllFamilies()
adapter.setSpeed(adapter.SPEED_REGULAR)
Set owc = CreateObject("OWAPI.OneWireContainer10")
i = 1
While adapter.findNextDevice = True
owAddress = adapter.getAddressAsString
owc.setupContainer adapter, owAddress
deviceName = owc.getName()
'get temperature
Set deviceState = owc.readDevice()
owc.doTemperatureConvert deviceState
currentTemp = owc.convertToFahrenheit(owc.getTemperature(deviceState))
hs.WriteLog "Debug", "Device Found: Address(" & i & ") = " & owAddress & " Name = " & deviceName & " Temp = " & currentTemp & CRLF
hs.SetDeviceString "t" & i, currentTemp & "° F"
'>>>>>>>>>>>>>>>>>>>>
'set the time & date on the temp devices t1, t2, t3, etc.
set_date = now
hs.SetDeviceLastChange "t" & i, set_date
'>>>>>>>>>>>>>>>>>>>>>>
Call LogTemp()
i = i + 1
Wend
' end exclusive use of adapter
adapter.endExclusive()
' free port used by adapter
adapter.freePort()
end sub '*** end GetTemps()
sub LogTemp()
'*********************************************************** ******************
' Log temperatures to a database
'*********************************************************** ******************
'* Declare and set objects/variables
' name of Access database file
Const strDatabaseName = "temperatures.mdb"
Dim objConn
Dim strConnectionString, strDatabase, strSQL
strDatabase = hs.GetAppPath & "/" & strDatabaseName
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDatabase
' Open database connection
Set objConn = CreateObject("ADODB.Connection")
objConn.Open(strConnectionString)
' Insert row
strSQL = "INSERT INTO tblTempLog (owAddress, Temp, ReadingDTS) VALUES ('" & owAddress & "', " & currentTemp & ", '" & Now &"')"
hs.WriteLog "Debug", strSQL
objConn.Execute strSQL
' Close database
objConn.Close
Set objConn = Nothing
end sub '*** end LogTemp()
 
I have no experience in this, but FWIW, here is the difference between the models (my emphasis added in bold):

Key Features

* True-Ground Interface to an RS232 COM Port for Reading and Writing 1-Wire® Devices
* Works with Bipolar as well as Unipolar Logic Signals
* Compatible to COM port of (±)5V to (±)12V (DB-9 Version Only) or (±)6V to (±)12V (DB-25 Version)
* Supports Reading and Writing at Regular and Overdrive Speeds
* Provides Strong Pullup to 5V for Temperature-, Crypto-, and EEPROM 1-Wire devices
* Programs 1-Wire EPROM Devices (DB-25 Version with External 12V Power Supply Only)
* Communicates at Data Rates of 9.6 (default), 19.2, 57.6, and 115.2kbps
* Standard DB-9 or DB-25 Female Connector and 6-lead RJ-11 Connector for Easy Attachment of Standard 1-Wire Cables and Probes
* Includes DS2502 Identification Chip (DS9097U-009 only)

* DS9097U-S09
o 9-Pin RS-232-C port
o Communicates with all iButtons; can read but not write to DS198x EPROM iButtons

* DS9097U-009
o 9-Pin RS-232-C port
o Has internal 64-bit address
o Communicates with all iButtons; can read but not write to DS198x EPROM iButtons
 
It is true that the -009 has an ID chip in it but otherwise should function exactly like the -S09 version.

It looks like the line
Code:
Set access = CreateObject("owapi.OneWireAccessProvider")
shouldn't even care at that point if there is an adapter attached or not. It is this line
Code:
Set adapter = access.getAdapter("{DS9097U}", "COM9")
which would actually talk to the adapter.

Eric
 
It is true that the -009 has an ID chip in it but otherwise should function exactly like the -S09 version.

It looks like the line
Code:
Set access = CreateObject("owapi.OneWireAccessProvider")
shouldn't even care at that point if there is an adapter attached or not. It is this line
Code:
Set adapter = access.getAdapter("{DS9097U}", "COM9")
which would actually talk to the adapter.

Eric

thanks....

Eric - any idea what might be causing my script error in the line

Set access = CreateObject("owapi.OneWireAccessProvider")

???

/Jim
 
I think we've found the problem. It seems that the DS9097U-009 is not a direct replacement for the DS9097U-S09....so the software is not compatible.

Does anyone know who the contact at Hobby Boards is?

/Jimboat
 
Back
Top