Index
RSS

Welcome Guest [ Log In | Register ]

 
Reply to this topicStart new topic
> LED I/O, LED light on U3
jakeshivers
post Nov 22 2009, 10:19 AM
Post #1

Joined: 22-November 09
Posts: 12




Hi,

I just bought the U3 and am playing around in CloudDot. How come this doesn't work? Is there some documentation out there that I don't know about?

CODE:
if Channel.FIOState == 0:
print "Turning LED on"
Channel.FIOState = 1
else:
print "Turning LED off"
Channel.FIOState = 0


ERROR:
Script running failed with: <class 'LabJackData.NoLatestReadingException'> Channel with nickname FIOState has no latest reading.
Traceback (most recent call last):
------------------------------------------------------------------------
File "<string>", line 9, in <module>
File "/usr/local/lib/python2.6/site-packages/LabJackData.py", line 578,\ in __getattr__
return self.getChannel(name)
File "/usr/local/lib/python2.6/site-packages/LabJackData.py", line 603, in getChannel
raise NoLatestReadingException("Channel\ with nickname %s has no latest reading." % channel['nickname'])
NoLatestReadingException: Channel with nickname FIOState has no latest reading.
------------------------------------------------------------------------
 
Quote Post
LabJack Support
post Nov 23 2009, 11:05 AM
Post #2

Joined: 9-June 03
Posts: 5527




Thanks for your interest in CloudDot. We think you'll really like it once you get into it.

QUOTE (jakeshivers @ Nov 22 2009, 10:19 AM) *
I just bought the U3 and am playing around in CloudDot. How come this doesn't work?
CODE
if Channel.FIOState == 0:
    print "Turning LED on"
    Channel.FIOState = 1
else:
    print "Turning LED off"
    Channel.FIOState = 0


That code (from our script library) will look at the current state of your FIOState channel and toggle it. The problem:

QUOTE (jakeshivers @ Nov 22 2009, 10:19 AM) *
NoLatestReadingException: Channel with nickname FIOState has no latest reading.


is that there is no current state of your FIOState channel because you haven't read from it or written to it yet. If you look on your Channels page, you'll see there is no reading for it. Click "Sample from the channel" to get its current state from the U3 or write a value to it by entering a value in the "Write new record:" textbox and click "Write". Once you get the first one in, the script will run fine, and it will toggle an LED connected from ground to whatever FIO you have FIOState connected to. We'll update the comments in this script to clarify this. Speaking of documentation,


QUOTE (jakeshivers @ Nov 22 2009, 10:19 AM) *
Is there some documentation out there that I don't know about?


If you haven't already, skim through this:

http://labjack.com/support/clouddot/users-...gh-and-tutorial

and because you have a U3, you'll use CloudDot Grounded to connect it to CloudDot:

http://labjack.com/support/clouddot/grounded

You want to be able to get to the last step on the CloudDot Grounded page above where your U3 is verified after clicking the "Verify" button. I see that your U3 isn't verified yet, so you'll need to do that first before your channels and scripts work.
 
Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RSS