Stephan's blog posts

"I may not have gone where I intended to go but I have ended up where I needed to be." — Douglas Adams

Step 7: Read status LED indicators of S7-300 CPU

This function obtains the status of the CPU LED indicators, for visualization on an HMI, for example. In this function block, we only output the status for system fault and a combined bus fault (for any interface), but you can easily change that.

Step 7: ANY pointer parameter

When writing a function / function block, you need to determine what parameter types you will expect. Sometimes, it would be nice to be able to determine that depending on the application.

For example, in the post Step 7: analog signal normalization the output parameter could be a pseudo percentage of type INT or a motor current of type REAL.

Step 7: analog signal normalization

You can use the Siemens function FC105 SCALE to scale an analog signal to engineering units but mostly this doesn't work well for me. One problem is that FC105 assumes that the A/D value lower limit is either 0 (uni-polar) or -27648 (bi-polar) and the upper limit 27648. However, this is often not the case. There may be a modest baseline noise at the low end and the maximum input may not exactly be 27648.

Gave up on Flickr

I have just canceled my Pro subscription. It was scheduled to renew in two days from now. I also deleted almost all of my thousands of photos from the service, most of which were set to friends and/or family.

Drupal 7: page title contains EM tags when editing node


Using Drupal 7, Page Title 7.x-2.7.

When editing a node, the page title for this post would be:

Edit Blog entry Drupal 7: page title contains EM tags when editing node

With the page title module the <em> tags are part of the <title> tags:

<title><em>Edit Blog entry</em> Drupal 7: page title contains EM tags when editing node</title>

This was also reported on Drupal.

Drupal: remove link to forum container


For anonymous users that don't have access to forums, I don't see why they should be able to access the forum container (and the message "no forums defined"). In order to send an anonymous user to a 403 page on /forum I first tried what I thought was the easiest, Drupal's drupal_access_denied(). This still rendered the action links, so I hid those first.

Drupal 7.x: allow users to delete their own comments


The module Comment goodness from jessebeach adds some functionality to the commenting system, such as sorting comments, as well as a new permission to allow users to delete their own comments. If you are just looking for the delete option then the other options may not be very useful. They also can, as was the case for me, interfere with existing templates and preprocess functions.

iOS 8.1.1: first update to leave Bluetooth untouched

iOS 8.1.1 may very well be the first update to leave the Bluetooth setting untouched. It was disabled prior to the update and I was pleased to see this was still the case after the reboot.

I understand it may benefit Apple to encourage users to enable it, but it has always struck me as very odd that the setting was completely ignored.

Hopefully this will be the case with future updates.

Drupal: lean page template for 403 and 404 errors


In order to reduce the server load and data sent on a 404 (not found) or a 403 (access denied) I prefer to serve a slimmed-down page without any blocks, etc. I copied page.tpl.php as page--error.tpl.php and removed most of the regions/blocks, breadcrumbs, menus, etc.

iOS 8 gripes

Here are a few issues I've encountered with iOS 8.0.2.

App Store update badge

The App Store app always indicates there are updates while the versions listed are already installed. Tried killing the app, rebooting the phone, syncing, force a refresh (tapping 9 times on the update button in the app). Nothing helps. Only if I download updates directly from the iPhone it detects it and reduces the counter in the app badge.