|
|
| Author |
Message |
erica Guest
|
Posted: Tue Oct 14, 2003 4:32 pm Post subject: Writing own software for Pt104 |
|
|
Hi,
I am trying to write my own software in excel using the Pt104 as I have 7 inputs. 6 single ended voltages and 1 temp sensor (Pt100).
The temp sensor is on Ch4 - connector 4 - works fine.
The 6 voltages inputs are connected to pins 2 and 3 on each of the connectors 1-3.
I can read my voltages on the pin 3 on each connector but '****' from pin 2 on each connector.
Am i missing something ?
this is a section of my code:
ok = pt104_get_value(uv1, port, 1, False)
If ok Then
Cells(i + 2, "A").value = i
Cells(i + 2, "B").value = uv1 / 100000000
Else
Cells(i + 2, "B").value = "****"
End If
ok = pt104_get_value(uv2, port, 2, False)
If ok Then
Cells(i + 2, "C").value = uv2 / 100000000
Else
Cells(i + 2, "C").value = "****"
End If
ok = pt104_get_value(uv3, port, 3, False)
If ok Then
Cells(i + 2, "D").value = uv3 / 100000000
Else
Cells(i + 2, "D").value = "****"
End If
ok = pt104_get_value(uv4, port, 4, False)
If ok Then
Cells(i + 2, "K").value = uv4 / 1000
Else
Cells(i + 2, "K").value = "****"
End If
ok = pt104_get_value(uv5, port, 5, False)
If ok Then
Cells(i + 2, "L").value = uv5 / 100000000
Else
Cells(i + 2, "L").value = "****"
End If
ok = pt104_get_value(uv5, port, 6, False)
If ok Then
Cells(i + 2, "M").value = uv6 / 100000000
Else
Cells(i + 2, "M").value = "****"
End If
ok = pt104_get_value(uv5, port, 7, False)
If ok Then
Cells(i + 2, "N").value = uv7 / 100000000
Else
Cells(i + 2, "N").value = "****"
End If |
|
| Back to top |
|
 |
markspencer Site Admin

Joined: 07 May 2003
Posts: 610
|
Posted: Wed Oct 15, 2003 7:39 am Post subject: |
|
|
Hi,
I have looked at your code and nothing seems to be incorrect. However, yuo will need to make calls to set_channel for each of the connectors, determining if they are temperature, resistance, differential voltage, or single ended voltage. This can be found in the help manual.
| Code: | void pt104_set_channel (
unsigned short port,
unsigned short channel,
unsigned short data_type
unsigned short no_of_wires);
You should call this routine once for each channel that you would like to take readings from. You can do this any time after calling pt104_open_unit.
The fewer channels are selected, the more frequently these channels will be updated: it takes about 1 second per active channel.
channel specifies which channel you want to set the details for: it should be between 1 and 4 or between 1 and 8 if using single ended inputs in voltage mode.
data_type set to the type of reading you require (1 for pt100, 2 for pt1000, 3 for resistance 0..500R, 4 for resistance 0..10k, 5 for differential voltage 0..100mv, 6 for differential voltage 0..2V5, 7 for single ended voltage 0..100mv and 8 for single ended voltage 0..2V5
no_of_wires specifies how many wires the pt100 or pt1000 has (set to 2, 3 or 4) |
When you first call the get_values function it will return false for a few readings until a vlid reading if reached. After the few reading True will be returned, it seems from what you have said that true is not being returned from the function call. This coulde be due to the set channel not being correct. I would aslo advise testing the PT104 and your set up with Picolog.
Best regards, |
|
| Back to top |
|
 |
erica Guest
|
Posted: Wed Oct 15, 2003 9:03 am Post subject: Reply to Pt104 writing own software |
|
|
Hi,
Sorry I didn't put all of my code in. I do set all the channels as shown below.
Set Channel 1 for a pt100
Call pt104_set_channel(port, 1, data_type, no_of_wires)
Call pt104_set_channel(port, 2, data_type, no_of_wires)
Call pt104_set_channel(port, 3, data_type, no_of_wires)
Call pt104_set_channel(port, 4, 1, no_of_wires)
Call pt104_set_channel(port, 5, data_type, no_of_wires)
Call pt104_set_channel(port, 6, data_type, no_of_wires)
Call pt104_set_channel(port, 7, data_type, no_of_wires)
where:
port =1 (com port 1)
data_type = 8 apart from temperature
no_of wires = 4
Is it something to do with using pin2 on the DIN connector?
Erica |
|
| Back to top |
|
 |
erica Guest
|
Posted: Wed Oct 15, 2003 10:31 am Post subject: |
|
|
Following previous reply. I have just done a little test and swapped my inputs from pin3 to pin2 and those that were on pin2 to pin3 - to check that it wasn't my inputs. The test shows that all 6 inputs can be read if placed on pin3 but none if placed on pin2.
Just to confirm the arrangment for single ended voltage input.
Pin 1 - n/c
Pin 2 - Ch5
Pin 3 - Ch1
Pin 4 - GND
Erica |
|
| Back to top |
|
 |
markspencer Site Admin

Joined: 07 May 2003
Posts: 610
|
Posted: Thu Oct 16, 2003 8:39 am Post subject: |
|
|
Single ended voltage connection are as follows:
Connector 1
Channel 1
Pin 3
Connector 1
Channel 5
Pin 2
Connector 2
Channel 2
Pin 3
Connector 2
Channel 6
Pin 2
Connector 3
Channel 3
Pin 3
Connector 3
Channel 7
Pin 2
Connector 4
Channel 4
Pin 3
Connector 4
Channel 8
Pin 2
Pin 4 is ground and pin 1 is not used.
Best regards,
Last edited by markspencer on Thu Oct 16, 2003 8:53 am; edited 1 time in total |
|
| Back to top |
|
 |
erica Guest
|
Posted: Thu Oct 16, 2003 8:47 am Post subject: |
|
|
This is the arrangement I have - so why can't I read voltages on any of my pin 2's ?
Erica |
|
| Back to top |
|
 |
ricardo Moderator

Joined: 07 May 2003
Posts: 98
|
Posted: Mon Oct 20, 2003 9:38 am Post subject: |
|
|
Hi,
We are investingating your query and will shortly get back to you.
Best Regards,
Ric |
|
| Back to top |
|
 |
ricardo Moderator

Joined: 07 May 2003
Posts: 98
|
Posted: Tue Oct 21, 2003 9:16 am Post subject: |
|
|
Hi,
To be able to help any further we need to know if you get the same results using PicoLog.
Best Regards,
Ric |
|
| Back to top |
|
 |
erica Guest
|
Posted: Thu Oct 23, 2003 8:45 am Post subject: |
|
|
I believe that using PICOLog with Pt104 is set up for four input channels only. Therefore I can read channels 1-4 which are my inputs on pins 3 of 3 connectors and Ch4 being the temperature sensor.
I don't think I can use PicoLog to read the inputs on pins 2 of the 3 connectors - this is why I am trying to write my own software (I wouldn't if I didn't have to).
Erica |
|
| Back to top |
|
 |
markspencer Site Admin

Joined: 07 May 2003
Posts: 610
|
Posted: Fri Oct 24, 2003 10:56 am Post subject: |
|
|
Hi,
I have done further investigation on the PT104 driver and have come to the conclusion that there is an error in it. This has been reported to the relevant department for a bug fix. Unfortunately, I am unable to give a time scale when this will be.
Best regards, |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|