Pac

Discussion in 'Pascal Logic Code Examples' started by Basil, Mar 28, 2006.

  1. Basil

    Basil

    Joined:
    Dec 30, 2005
    Messages:
    38
    Likes Received:
    0
    Location:
    Isle of Wight UK
    Hi
    I am new to the PAC but have managed to get a couple of bits of logic running, I have a question regarding light levels, if I want to run some logic with the condition that a certain lux level is reached can I do this with the modual wizard ? if so how? for example I have a SENPILL and a light level sensor to get the levels from. also I have a Mono touch that I have put 2 indircators on to display the lux levels from these 2 sensors but they always display the same levels and these are different from the levels sent when I connect though toolkit. sorry if these questions seem a bit basic I am trying to get on the advanced course in the uk but clipsal uk told me they have none planned so its self taught at the moment!:confused: Iam thinking of coming to Australia to do it:)

    Thanks
     
    Basil, Mar 28, 2006
    #1
  2. Basil

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The PAC does not have the ability to read the light level from light level sensors.

    Are you saying that the displayed lux level never changes, even if the ambient light level changes ?

    The displayed level will not change until the next time it polls the light level sensor. For example, if you have the rate set to 1 minute, then there could be up to 1 minute delay between the light level changing and the value on the screen changing.
     
    Darren, Mar 29, 2006
    #2
  3. Basil

    Basil

    Joined:
    Dec 30, 2005
    Messages:
    38
    Likes Received:
    0
    Location:
    Isle of Wight UK
    Hi Darren

    Thanks for that you saved me a lot of time I asume that the colour touch would be able to read light levels is this correct?

    Yes it just displays the same reading night or day I have asked it to refresh evey 20 seconds
     
    Basil, Mar 29, 2006
    #3
  4. Basil

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Are you absolutely sure that you have the right unit address (not getting confused with hex and decimal) ? If you have selected the unit address of, for example, a key unit, you will get meaningless (but consistent) data.
     
    Darren, Mar 29, 2006
    #4
  5. Basil

    phcjpp

    Joined:
    Oct 19, 2004
    Messages:
    112
    Likes Received:
    0
    Location:
    London
    You could have your light lvl sensor set a group say 'light' when a lvl is reached and the pac can pick that up. Of course this only supports one light lvl.

    In my pack I just use the sunset / sunrise times and do logic off them - works a charm.

    Chris
     
    phcjpp, Apr 5, 2006
    #5
  6. Basil

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide
    from the help file

    The functions you speak of are listed in the PICED/ homegate/schedplus LOGIC help file.

    if you type in "getunitparameter" in the logic help index it will show the following info,
    bearing in mind it does say that PAC unit does not support this function.

    GetUnitParameter
    The GetUnitParameter function returns the value of a C-Bus unit parameter.
    This is not applicable for use with the Pascal Automation Controller.

    Syntax

    GetUnitParameter(Network, UnitAddress, ParameterType)

    Network is an Integer or Network Tag.
    UnitAddress is an Integer.
    ParameterType is an Integer.

    Description

    The real result is the value of the selected parameter on the selected unit. The options for the ParameterType are :


    Value Constant Parameter Returned Applicable Unit Types
    1 ptTemperature Temperature (oC or oF) Temperature Sensor
    2 ptLightLevel Light Level (Lux) Light Level Sensor
    3 ptVoltage Voltage (Volts) C-Bus 2 Output Units
    Notes :

    ? The unit address must correspond to a unit of the correct type to get meaningful data.
    ? A Monitor component with the matching unit address and parameter
    must be used in the Project in order to have the data available.
    ? The values returned are only as accurate as the unit sensors. Without calibration, the accuracy is not guaranteed.
    ? The units of temperature (oC or oF) are set in the PICED Project
    Details.

    ? The unit parameter status should be checked before the value is used

    Example

    To assign the light level of unit address 5 on the Local Network to the variable Level :

    Level := GetUnitParameter("Local Network", 5, ptLightLevel);
     
    coppo, Apr 13, 2006
    #6
  7. Basil

    Basil

    Joined:
    Dec 30, 2005
    Messages:
    38
    Likes Received:
    0
    Location:
    Isle of Wight UK
    Sorry I did not answer thease posts I have been out of action for a while thanks for all you help.
     
    Basil, Jul 7, 2006
    #7
  8. Basil

    Beerygaz

    Joined:
    Dec 25, 2005
    Messages:
    52
    Likes Received:
    0
    Location:
    Johannesburg, South Africa
    Is it still the case that PAC can't read light levels?

    Sunset/sunrise times are well and good, but in a country where heavy thunder clouds come over in the afternoon, it's not ideal.

    Setting a group address on sunset is one way around, but ramping lights based on different lux levels is a lot more aesthetic rather than a binary setting.
     
    Beerygaz, Feb 5, 2007
    #8
  9. Basil

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Yes, but it is on the (very long) list of things to do.
     
    Darren, Feb 6, 2007
    #9
  10. Basil

    David Connors (Codify)

    Joined:
    Apr 27, 2005
    Messages:
    6
    Likes Received:
    0
    Location:
    Brisbane
    I have a bit of logic running in HomeGate in our house that I was intending to move into a PAC in the future so we can delete the PC from the equation.

    Is there a chart or list somewhere that shows the difference in functionality in HomeGate Logic vs the PAC? I haven't written any code for the PAC and haven't actually bought it yet. I don't want to write a whole bunch of stuff in HomeGate Logic that is impossible to port to the PAC.

    David.
     
    David Connors (Codify), Mar 6, 2007
    #10
  11. Basil

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    The PAC obviously doesn't support system IO and any sort of graphics. The best test would be to create a PAC project in PICED and copy the source code from your Homegate project over to the PICED file. You will get compile errors for anything that does not match up between the platforms. The compile errors will also point you to the offending code with a simple double click. PICED is free and you can simulate your PAC project fully in the PICED programming environment. Forget Rudd and Howard - Vote 1 Darren for PM :D
     
    Phil.H, Mar 6, 2007
    #11
  12. Basil

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The logic help file which comes with PICED states which functions can not be used in the PAC. You can download PICED from the CIS web site http://www2.clipsal.com/cis/technical/downloads.
     
    Darren, Mar 6, 2007
    #12
  13. Basil

    Duncan

    Joined:
    Jul 23, 2004
    Messages:
    925
    Likes Received:
    0
    Location:
    Salinas de Garci Mendoza, Bolivia
    Hear! Hear!..

    And whats best is that as PM.. he'll get a Chauffeur to drive him around.. then this sort of thing wont be happening to him again:

    [​IMG]
     
    Duncan, Mar 6, 2007
    #13
  14. Basil

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Oh my God,

    Looks like someone was way to keen to get inside and have a couple of beers. ;)
     
    Phil.H, Mar 6, 2007
    #14
  15. Basil

    David Connors (Codify)

    Joined:
    Apr 27, 2005
    Messages:
    6
    Likes Received:
    0
    Location:
    Brisbane
    Okay cool. The lack of UI was a given. :) I was more worried about language or capability differences. Thank you all for your help.
     
    David Connors (Codify), Mar 14, 2007
    #15
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.