How do I check that a printer tray exists before using srw.set_printer_tray

Due to printer firmware issues I cannot know in advance whether the printer's tray number has a space in front of it.
Ex: '2' vs. ' 2'
I have introduced this code to production, but if the tray value passed in does not exist, then an error is thrown when setting the printer tray.
If I cannot determine this in advance, then I would like the code not to fail and simply skip the assignment. The printer tray selection is only a convenience to the end user. This is important becasue I have hundreds of printers to which a report may be printed.
function BetweenPage return boolean is
begin
IF :PLABLE_TRAY IS NOT NULL AND :PLABLE_TRAY <> '' THEN
     srw.set_printer_tray(:PLABLE_TRAY);
return (TRUE);
END IF;
return (TRUE);
end;
Thx in advance,
Gary

high-Q wrote:
It's an autonomous test station with various measurement instruments. I'm closing the bus after reciving the string from each instrument.
Again, that makes no sense.  Part of the command over the bus is the address.  So if you know all of your instruments' addresses, you just supply that when you iteract with that instrument.  There is no reason to constantly open and close your bus.
The problem with checking to see if data is available is that you have to send a querry to the instrument.  You are the master of the bus.  Nobody else can send data without you letting them.  So you have to keep you bus open and send querries to check to see if the oscilloscope is ready to send data.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • I have just bought an ipad with retina display wifi and 4g 16gb how can I check that this is what I have been supplied with please

    I have just bought an ipad with retina display wifi and 4g 16 gb - how can I check that this is what I have been supplied with

    Identifying iPad Models:
    http://support.apple.com/kb/HT5452

  • How can I check that second hand macbook air is not stolen?

    How can I check that second hand macbook air is not stolen?

    Ask for the original purchase receipts.
    Take it to the Apple store  and make sure that the computer is not stolen
    provided they have any such information.
    Best.

  • HT201250 how can I check that all photos have been backed up in time machine

    I have used Time Machine for the first time to back up my Macbook Air. Macbook Air's iPhoto shows approx 5200 pictures on file.
    How can I check that the external hard drive (Time Machine) has all 5200 saved correctly before deleting the photos from the Macbook Air ?

    The only way to check a back up is to do a restore of it.
    However, why are you deleting your photos from the MBA? If you do they will also be deleted from Time Machine eventually. TM keeps a rolling back up of your machine. It copies and maintains your additions and deletions. Eventually, these photos will be deleted from TM too. It's not an archiving app.
    Regards
    TD

  • How can i check that who end the session

    Hi to all ,
    my query is that how can i check that who end the session.
    through SM04 user who have the authontication can end the session so how can i check that who end the session being a BASIS admin.
    Thanks & Regards

    It's wrotes in system log, check in sm21.
    Regards.

  • HT1338 how do I check that I have anti virus protection on my mac

    how do I check that I have antivirus protection on my mac

    jaspergreer wrote:
    how do I check that I have antivirus protection on my mac
    Your profile says you are using OS X Mountain Lion, so if that's true then you have all of Apple's anti-virus protection and if Software Update says you are fully up-to-date on all your Security, Java, etc. updates, then you are fully protected against all currently known malware that can impact OS X and Apple apps.
    Keep Java (not JavaScript) disabled in all your browsers unless you must visit a site that requires it, and turn it back off as soon as you are finished to make certain you aren't one of the first to discover the next Java threat that will most certainly show up one day soon.

  • HT4972 how i can check that my phone is factory unlock or not

    how i can check that my phone is factory unlock or not

    Look at the other thread you started.  Running two active threads is confusing, not only to you but to those who are trying to help.

  • How can i check that server still running?

    Hi everybody,
    How can i check that server still running before sending post?

    There are several ways of verifying if server is still running
    1) Through JCMon command line tool on server
    Call jcmon as <sid>adm using following command
    jcmon pf=/usr/sap/<sid>SYS/profile/<sid>_<instance>_<host>
    jcmon displays the server processes in status "Running" if all applications have started successfully. Otherwise it displays the appropriate status message
    2) Through SAP MMC which again shows the graphical status as Green
    3) On NWDS using J2EE view
    4) If telnet port is enabled on J2EE Engine, then you can remotely check the status of server using telnet command

  • How to achieve Check point functionality in SSIS with out using check point.

    I got question from
    interview!!! How
    to achieve Check
    point functionality in SSIS with out using check point. If package
    fails it has to be re-run from the point that it failed instead
    of rerunning the entire package.without
    using check point.
    Please
    any one can explain step by step...

    Sorry you have failed your interview question. Good thing you remembered it, thought about it, and ask a question about it. The solution is actually very straightforward.
    Create a table to store the state of your progress. Before each step read the table to find out where left off, then skip each completed step. After each step write to the table which step you have completed. A step can be anything, a task, a component,
    a row, an import file, an export file. You don't have to use a table, it could also be a file, just something you can read and write, and does not disappear when your package stops.
    If you find this difficult to comprehend, think of a checklist of things you do everyday and work from there.

  • Can somebody explain to me how I can detect that an internet connection exists (VB)?

    Can somebody explain to me how I can detect that an internet connection exists (VB)?
    Peter Goossens

    There is no reliable way. Better test whether you can go to where you want to go. And be prepared to support proxies, even the complex ones that require authentication. 
    System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable reports your local connectivity regardless of whether one of your connected networks has Internet access.
    Microsoft's Network Awareness API (the one used in control panel\network and sharing center) use a connection test to a web site setup by Microsoft. But your customers could be behind cooperative firewalls that make this test unusable even when Internet
    access is available though other means (e.g. via a local proxy server). If you want to connect to your own web site, then you can skip that and just connect to your web site instead. Even if you were able to connect to Microsoft's web site there is no guarantee
    your web site would be accessible in the same network.
    Visual C++ MVP

  • How do I check internet usage history? When i use the "History" tab on the tool bar all I see is today's activity & the calendar does not change when I click on it. Thanks

    How do I check internet usage history? When i use the "History" tab on the tool bar all I see is today's activity & the calendar does not change when I click on it. Thanks

    zedzed,
    Here's another thought.
    Navigate to HD > Users > Library > Safari: Make a duplicate of History.plist.
    To duplicate the file, click once to highlight it. Press the Command + D keys.
    Drag the History,plist copy file to the Desktop.
    Highlight it. Press the Command + I keys, to get info.
    Change Open With to TextEdit.
    When you open the file in TextEdit, it will be difficult to read, but you will be able to pick out some sites.
    ali b

  • If I buy an iphone second hand, how can I check that is valid and purchased for real?, If I buy an iphone second hand, how can I check that is valid and purchased for real?

    Hello
    I'd like to buy an iphone second hand and although I trust the source I'd like to be able to check with certainty that the phone was bought instore.
    I was thinking to ask for the receipt and check the serial number. is the serial number written on the back of the phone and the recipt(if the phone is sealed)?
    Similarly, if I buy an ipad 3 or 4 second hand, how do you check this again?
    Please let me know with some details about this.
    Thanks
    Anthony

    Ask the person you are buying the phone from to provide the original proof of purchase for the phone. If you do not know the seller personally I would be very cautious about purchasing the phone. There are many many stolen, hacked and jailbroken phones out there and these will only cause you grief down the road.

  • Why have I been sent an email asking me for my Apple ID and Password. How can I check that this is not a scam.

    I want to know why I have been sent an email from Apple to verify my account by asking for my Apple ID and password.
    how do I know this is genuine and is there a way to check that this is not a scam

    I would be very careful about email asking for your Apple ID and password. These are some of the Official Apple email addresses that would contact you:
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    These email are not to be replied to at all and if the email you receive asks you to reply or has a link that doesn't go the Apple.com or iCloud.com domains, then they are definitely fake.

  • I have installed mac keeper and they have identified issues? With my Mac. How can I check that my Mac is running at its optimum and is safe from viruses?

    I have installed mac keeper and it has initially found numerous issues? with my Mac. What can I do with the existing software to check that my mac is running at its optimum and get rid of these issues.

    By uninstalling mackeeper. That software is garbage and will cause more problems then good. Get rid of it immediately.

  • How do I check if section and subdivision exist inside object's xml?

    My function is working but not as I expect it to. The problem is that when Section and Subvision are not found in the object aobjXmlGetStatuteRequestNode xml, I get an error NullReference Exception was unhandled by user code. Object reference not set
    to an instance of an object. 
    For that reason, because the two elements are optional, I would like to check if they exist before adding their value into the xml inside the object objXmlRequestMessageDoc.
    The if statement I used in my function did not work. When it found Section element, it did not check for Subdivision. 
    How do I check for both and add them if they exist. If they do not exist, I do not need to do anything and should not throw an error since they are optional.
     Object aobjXmlGetStatuteRequestNode has this xml
    <ns:GetStatutesRequest xmlns:ns="http://www.courts.state.mn.us/StatuteService/1.0">
    <ns:Statute>
    <ns:Chapter>169</ns:Chapter>
    <!--Optional:-->
    <ns:Section>191</ns:Section>
    <!--Optional:-->
    <ns:Subdivision>a</ns:Subdivision>
    </ns:Statute>
    The following output in the objXmlRequestMessageDoc object is correct but this does not work when Section and or Subdivision are not found in the object aobjXmlGetStatuteRequestNode.
    <ns:BasicSearchQueryRequest xmlns:ns="http://crimnet.state.mn.us/mnjustice/statute/service/4.0">
    <ns1:BasicSearchCriteria xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0">
    <ns2:Chapter xmlns:ns2="http://crimnet.state.mn.us/mnjustice/statute/4.0"/169</ns2:Chapter>>
    <ns2:Section xmlns:ns2="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>191</ns2:Chapter>
    <ns2:Subdivision xmlns:ns2="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>a</ns2:Chapter>
    </ns1:BasicSearchCriteria>
    </ns:BasicSearchQueryRequest>
    My Function
    Function GetStatutesByChapter(ByVal aobjXmlGetStatuteRequestNode As XmlNode, ByVal aobjXMLNameSpaceManager As XmlNamespaceManager, ByVal aobjBroker As ServiceCatalog.Library.v4.Broker) As XmlDocument
    Dim objXmlRequestMessageDoc As XmlDocument
    Dim objXmlResponseMessageDoc As XmlDocument
    Dim intCount As Integer
    aobjBroker.PostMessageWarehouseInformationalMessage("Chapter found.", 1)
    objXmlResponseMessageDoc = New XmlDocument
    'Add the first element into the document GetStatuteByChapter with its namespace
    objXmlResponseMessageDoc.AppendChild(objXmlResponseMessageDoc.CreateElement("BasicSearchQueryResponse", "http://crimnet.state.mn.us/mnjustice/statute/service/4.0"))
    'Create the BCA request message
    objXmlRequestMessageDoc = New XmlDocument
    objXmlRequestMessageDoc.AppendChild(objXmlRequestMessageDoc.CreateElement("ns:BasicSearchQueryRequest", aobjXMLNameSpaceManager.LookupNamespace("ns")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns1:BasicSearchCriteria", aobjXMLNameSpaceManager.LookupNamespace("ns1")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Chapter", aobjXMLNameSpaceManager.LookupNamespace("st")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Section", aobjXMLNameSpaceManager.LookupNamespace("st")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Subdivision", aobjXMLNameSpaceManager.LookupNamespace("st")))
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Chapter", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Chapter", aobjXMLNameSpaceManager).InnerText
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Section", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager).InnerText
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Subdivision", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Subdivision", aobjXMLNameSpaceManager).InnerText
    'check if there is a section and or subdivision if it is there then set the value
    'If Not (aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager).InnerText) Is Nothing Then
    ' objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Section", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager).InnerText
    'End If
    'check if there is a section and or subdivision if it is there then set the value
    aobjBroker.PostMessageWarehouseSnapshot(objXmlRequestMessageDoc.OuterXml, "Request Message", 1)
    'Call the BCA service
    intCount = 0
    'Count how many Statute node found
    CType(objXmlResponseMessageDoc.SelectSingleNode("ss:GetStatutesResponse/ss:StatutesXml/ss:Statutes", aobjXMLNameSpaceManager), System.Xml.XmlElement).SetAttribute("totalCount", CStr(intCount))
    Return objXmlResponseMessageDoc
    End Function

    I have resolved this issue by using two if statements as follows
    'check if there is a section and or subdivision if it is there then set the value
    If Not (aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager) Is Nothing) Then
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Section", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager).InnerText
    End If
    If Not (aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Subdivision", aobjXMLNameSpaceManager) Is Nothing) Then
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Subdivision", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Subdivision", aobjXMLNameSpaceManager).InnerText
    End If

Maybe you are looking for